From f78491794e54f0f30598cef95d6ca43066f2a729 Mon Sep 17 00:00:00 2001 From: Maximilian Pollak Date: Fri, 6 Dec 2024 14:00:42 +0100 Subject: [PATCH] Changed paths to no work with build tools --- noxfile.py | 5 +++-- setup.py | 6 +++--- sphinxcontrib/__init__.py | 1 - sphinxcontrib/test_reports/__init__.py | 2 +- .../test_reports/directives/test_case.py | 4 ++-- .../test_reports/directives/test_common.py | 6 +++--- .../test_reports/directives/test_file.py | 8 ++++---- .../test_reports/directives/test_report.py | 4 ++-- .../test_reports/directives/test_results.py | 2 +- .../test_reports/directives/test_suite.py | 10 +++++----- sphinxcontrib/test_reports/test_reports.py | 16 ++++++++-------- 11 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 sphinxcontrib/__init__.py diff --git a/noxfile.py b/noxfile.py index bb0b81f..b690b4d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,8 +1,8 @@ import nox from nox import session -PYTHON_VERSIONS = ["3.8", "3.9", "3.10"] -SPHINX_VERSIONS = ["5.0", "6.2.1", "7.1.2", "7.2.5"] +PYTHON_VERSIONS = ["3.10", "3.11", "3.12"] +SPHINX_VERSIONS = ["7.1.2", "7.2.5", "7.4.1"] TEST_DEPENDENCIES = [ "pytest", "pytest-xdist", @@ -23,6 +23,7 @@ def run_tests(session, sphinx): session.install(".") session.install(*TEST_DEPENDENCIES) session.run("pip", "install", f"sphinx=={sphinx}", silent=True) + session.run("pip", "install", "sphinx-needs==3.0", silent=True) session.run("pip", "install", "-r", "doc-requirements.txt", silent=True) session.run("make", "test", external=True) diff --git a/setup.py b/setup.py index d8f585b..239d0fc 100644 --- a/setup.py +++ b/setup.py @@ -2,9 +2,9 @@ import os -from setuptools import find_packages, setup +from setuptools import find_namespace_packages, setup -requires = ["sphinx>=4.0", "lxml", "sphinx-needs>=1.0.1"] +requires = ["sphinx>=7.4.1", "lxml", "sphinx-needs>=1.0.1", "setuptools"] with open(os.path.join(os.path.dirname(__file__), "README.rst")) as file: setup( @@ -36,7 +36,7 @@ "Topic :: Documentation", ], platforms="any", - packages=find_packages(), + packages=find_namespace_packages(include=['sphinxcontrib.*']), include_package_data=True, install_requires=requires, namespace_packages=["sphinxcontrib"], diff --git a/sphinxcontrib/__init__.py b/sphinxcontrib/__init__.py deleted file mode 100644 index 1288267..0000000 --- a/sphinxcontrib/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__("pkg_resources").declare_namespace(__name__) # noqa: F401 diff --git a/sphinxcontrib/test_reports/__init__.py b/sphinxcontrib/test_reports/__init__.py index f546f90..539cede 100644 --- a/sphinxcontrib/test_reports/__init__.py +++ b/sphinxcontrib/test_reports/__init__.py @@ -1,2 +1,2 @@ # from sphinxcontrib.test_reports.needs.dyn_functions import Results4Needs -from sphinxcontrib.test_reports.test_reports import setup +from .test_reports import setup diff --git a/sphinxcontrib/test_reports/directives/test_case.py b/sphinxcontrib/test_reports/directives/test_case.py index ab8b1c9..39cc0cc 100644 --- a/sphinxcontrib/test_reports/directives/test_case.py +++ b/sphinxcontrib/test_reports/directives/test_case.py @@ -3,8 +3,8 @@ from sphinx_needs.api import add_need from sphinx_needs.utils import add_doc -from sphinxcontrib.test_reports.directives.test_common import TestCommonDirective -from sphinxcontrib.test_reports.exceptions import TestReportInvalidOption +from .test_common import TestCommonDirective +from ..exceptions import TestReportInvalidOption class TestCase(nodes.General, nodes.Element): diff --git a/sphinxcontrib/test_reports/directives/test_common.py b/sphinxcontrib/test_reports/directives/test_common.py index 68c4af3..7e86cfd 100644 --- a/sphinxcontrib/test_reports/directives/test_common.py +++ b/sphinxcontrib/test_reports/directives/test_common.py @@ -8,10 +8,10 @@ from sphinx.util import logging from sphinx_needs.api import make_hashed_id -from sphinxcontrib.test_reports.exceptions import ( +from ..exceptions import ( SphinxError, TestReportFileNotSetException) -from sphinxcontrib.test_reports.jsonparser import JsonParser -from sphinxcontrib.test_reports.junitparser import JUnitParser +from ..jsonparser import JsonParser +from ..junitparser import JUnitParser # fmt: on diff --git a/sphinxcontrib/test_reports/directives/test_file.py b/sphinxcontrib/test_reports/directives/test_file.py index b2c6b59..5b01498 100644 --- a/sphinxcontrib/test_reports/directives/test_file.py +++ b/sphinxcontrib/test_reports/directives/test_file.py @@ -5,9 +5,9 @@ from sphinx_needs.api import add_need from sphinx_needs.utils import add_doc -import sphinxcontrib.test_reports.directives.test_suite -from sphinxcontrib.test_reports.directives.test_common import TestCommonDirective -from sphinxcontrib.test_reports.exceptions import TestReportIncompleteConfiguration +from .test_suite import TestSuiteDirective +from .test_common import TestCommonDirective +from ..exceptions import TestReportIncompleteConfiguration class TestFile(nodes.General, nodes.Element): @@ -124,7 +124,7 @@ def run(self): arguments = [suite["name"]] suite_directive = ( - sphinxcontrib.test_reports.directives.test_suite.TestSuiteDirective( + TestSuiteDirective( self.app.config.tr_suite[0], arguments, options, diff --git a/sphinxcontrib/test_reports/directives/test_report.py b/sphinxcontrib/test_reports/directives/test_report.py index 53c8065..288376c 100644 --- a/sphinxcontrib/test_reports/directives/test_report.py +++ b/sphinxcontrib/test_reports/directives/test_report.py @@ -4,9 +4,9 @@ from docutils import nodes from docutils.parsers.rst import directives -from sphinxcontrib.test_reports.directives.test_common import \ +from .test_common import \ TestCommonDirective -from sphinxcontrib.test_reports.exceptions import InvalidConfigurationError +from ..exceptions import InvalidConfigurationError # fmt: on diff --git a/sphinxcontrib/test_reports/directives/test_results.py b/sphinxcontrib/test_reports/directives/test_results.py index 46fc8fe..9cc2f6e 100644 --- a/sphinxcontrib/test_reports/directives/test_results.py +++ b/sphinxcontrib/test_reports/directives/test_results.py @@ -3,7 +3,7 @@ from docutils import nodes from docutils.parsers.rst import Directive -from sphinxcontrib.test_reports.junitparser import JUnitParser +from ..junitparser import JUnitParser class TestResults(nodes.General, nodes.Element): diff --git a/sphinxcontrib/test_reports/directives/test_suite.py b/sphinxcontrib/test_reports/directives/test_suite.py index 0d30da7..03236ad 100644 --- a/sphinxcontrib/test_reports/directives/test_suite.py +++ b/sphinxcontrib/test_reports/directives/test_suite.py @@ -5,9 +5,9 @@ from sphinx_needs.api import add_need from sphinx_needs.utils import add_doc -import sphinxcontrib.test_reports.directives.test_case -from sphinxcontrib.test_reports.directives.test_common import TestCommonDirective -from sphinxcontrib.test_reports.exceptions import TestReportInvalidOption +from .test_case import TestCaseDirective +from .test_common import TestCommonDirective +from ..exceptions import TestReportInvalidOption class TestSuite(nodes.General, nodes.Element): @@ -121,7 +121,7 @@ def run(self, nested=False, count=-1): arguments = [suite["name"]] suite_directive = ( - sphinxcontrib.test_reports.directives.test_suite.TestSuiteDirective( + TestSuiteDirective( self.app.config.tr_suite[0], arguments, options, @@ -176,7 +176,7 @@ def run(self, nested=False, count=-1): arguments = [case["name"]] case_directive = ( - sphinxcontrib.test_reports.directives.test_case.TestCaseDirective( + TestCaseDirective( self.app.config.tr_case[0], arguments, options, diff --git a/sphinxcontrib/test_reports/test_reports.py b/sphinxcontrib/test_reports/test_reports.py index 118c464..8af9a7b 100644 --- a/sphinxcontrib/test_reports/test_reports.py +++ b/sphinxcontrib/test_reports/test_reports.py @@ -7,20 +7,20 @@ from sphinx_needs.api import (add_dynamic_function, add_extra_option, add_need_type) -from sphinxcontrib.test_reports.directives.test_case import (TestCase, +from .directives.test_case import (TestCase, TestCaseDirective) -from sphinxcontrib.test_reports.directives.test_env import (EnvReport, +from .directives.test_env import (EnvReport, EnvReportDirective) -from sphinxcontrib.test_reports.directives.test_file import (TestFile, +from .directives.test_file import (TestFile, TestFileDirective) -from sphinxcontrib.test_reports.directives.test_report import ( +from .directives.test_report import ( TestReport, TestReportDirective) -from sphinxcontrib.test_reports.directives.test_results import ( +from .directives.test_results import ( TestResults, TestResultsDirective) -from sphinxcontrib.test_reports.directives.test_suite import ( +from .directives.test_suite import ( TestSuite, TestSuiteDirective) -from sphinxcontrib.test_reports.environment import install_styles_static_files -from sphinxcontrib.test_reports.functions import tr_link +from .environment import install_styles_static_files +from .functions import tr_link sphinx_version = sphinx.__version__ if Version(sphinx_version) >= Version("1.6"):