Skip to content

Commit

Permalink
Merge pull request #140 from npilon/sphinx-mermaid-pep-420
Browse files Browse the repository at this point in the history
Use PEP 420 Native Namespace Packages
  • Loading branch information
timkpaine authored Sep 12, 2024
2 parents 30e6a13 + f48589c commit 2431f9a
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 21 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: docs/requirements.txt
cache-dependency-path: setup.py

- name: Install dependencies
run: |
python -m pip install -r docs/requirements.txt
python -m pip install -U pytest
python -m pip install -e .
python -m pip install -e .[test]
- name: Test
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Sphinx<7
Sphinx
myst-parser>=1.0.0
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import find_packages, setup
from setuptools import find_namespace_packages, setup

readme = open("README.rst", encoding="utf-8").read()
changes = open("CHANGELOG.rst", encoding="utf-8").read()
Expand Down Expand Up @@ -58,8 +58,9 @@ def remove_block(text, token, margin=0):
"Topic :: Utilities",
],
platforms="any",
packages=find_packages(),
packages=find_namespace_packages(where='./', include=['sphinxcontrib.mermaid']),
package_dir={'': './'},
include_package_data=True,
install_requires=["sphinx", "pyyaml"],
namespace_packages=["sphinxcontrib"],
extras_require={'test': ['myst-parser', 'defusedxml', 'sphinx', 'pytest']},
)
12 changes: 0 additions & 12 deletions sphinxcontrib/__init__.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 9 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
from pathlib import Path

import pytest
from sphinx.testing.path import path
import sphinx
from packaging.version import Version


pytest_plugins = 'sphinx.testing.fixtures'


@pytest.fixture(scope='session')
def rootdir():
return path(__file__).parent.abspath() / 'roots'
if Version(sphinx.__version__) < Version('7.0.0'):
from sphinx.testing.path import path
return path(__file__).parent.abspath() / 'roots'
return Path(__file__).parent.absolute() / 'roots'

0 comments on commit 2431f9a

Please sign in to comment.