diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index e54201d..5333e59 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: [3.8, 3.13] + python-version: [3.9, 3.13] env: OS: ${{ matrix.os }} steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a8ef1e..fe2f112 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ### Infrastructure * use trusted publisher for release (see https://docs.pypi.org/trusted-publishers/) -* pin Python 3.7 builds to ubuntu 22.04 (not available in 24.04) +* use `pyproject.toml` for project setup ### Documentation * added use case for ordering test modules (see [#51](https://github.com/pytest-dev/pytest-order/issues/51)) diff --git a/docs/source/conf.py b/docs/source/conf.py index c5dcce9..d1d1d60 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,7 +18,7 @@ import os import sys -sys.path.insert(0, os.path.abspath("../..")) +sys.path.insert(0, os.path.abspath("../../src")) from pytest_order import __version__ # noqa: E402 diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index b016e31..0000000 --- a/mypy.ini +++ /dev/null @@ -1,19 +0,0 @@ -[mypy] -; Ensures correct typing information inside non-typed functions -check_untyped_defs = True -; Strict checking for None -no_implicit_optional = True -; Disallow none and partial generics -disallow_any_generics = True -; Point out pointless things -warn_redundant_casts = True -warn_unused_ignores = True -; Misc -show_error_codes = True - -; These are needed for VSCode -; Silences errors about missing imports -; (type-checks correctly when they're not missing tho) -ignore_missing_imports = True -; Needed to position the underline correctly -show_column_numbers = True diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..26a705a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,79 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", +] +build-backend = "setuptools.build_meta" + +[project] +name = "pytest-order" +description = "pytest plugin to run tests in a specific order" +readme = "README.md" +keywords = [ + "testing", + "pytest", + "ordering", +] +license = "MIT" +license-files = ["LICENSE"] +requires-python = ">=3.9" +dynamic = ["version"] +dependencies = [ + "pytest>=5.0; python_version < '3.10'", + "pytest>=6.2.4; python_version >= '3.10'", +] +authors = [ + {name = "mrbean-bremen", email = "hansemrbean@googlemail.com"} +] +classifiers = [ + "Intended Audience :: Developers", + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Programming Language :: Python", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Topic :: Software Development :: Testing", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Utilities", +] + +[project.optional-dependencies] +dev = [ + "pytest-mock>=1.11.0", + "pytest-xdist>=1.29.0", + "pytest-dependency>=0.5.1", +] + +[project.urls] +homepage = "https://github.com/pytest-dev/pytest-order" +documentation = "https://pytest-order.readthedocs.io/" +download = "https://github.com/pytest-dev/pytest-order/archive/main.zip" +repository = "https://github.com/pytest-dev/pytest-order" +changelog = "https://github.com/pytest-dev/pytest-order/blob/main/CHANGELOG.md" +issues = "https://github.com/pytest-dev/pytest-order/issues" + +[project.entry-points.pytest11] +pytest_order = "pytest_order.plugin" + +[tool.setuptools.dynamic] +version = {attr = "pytest_order.__version__"} + +[tool.pytest.ini_options] +testpaths = ["tests"] + +[tool.mypy] +mypy_path = "src/" +no_namespace_packages = true +check_untyped_defs = true +no_implicit_optional = true +disallow_any_generics = true +warn_redundant_casts = true +warn_unused_ignores = true +show_error_codes = true +ignore_missing_imports = true +show_column_numbers = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ccdd272..0000000 --- a/setup.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[metadata] -description_file = README.md -license_files = LICENSE -[bdist_wheel] -universal=0 -[tool:pytest] -testpaths = tests diff --git a/setup.py b/setup.py deleted file mode 100644 index c18b61c..0000000 --- a/setup.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup -import os - -__here__ = os.path.abspath(os.path.dirname(__file__)) - -from pytest_order import __version__ - -with open(os.path.join(__here__, "README.md")) as f: - LONG_DESCRIPTION = f.read() - - -setup( - name="pytest-order", - description="pytest plugin to run your tests in a specific order", - long_description=LONG_DESCRIPTION, - long_description_content_type="text/markdown", - version=__version__, - author="mrbean-bremen", - author_email="hansemrbean@googlemail.com", - url="https://github.com/pytest-dev/pytest-order", - packages=["pytest_order"], - license="MIT", - entry_points={ - "pytest11": [ - "pytest_order = pytest_order.plugin", - ] - }, - python_requires=">=3.7", - install_requires=[ - "pytest>=5.0; python_version < '3.10'", - "pytest>=6.2.4; python_version >= '3.10'", - ], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: POSIX", - "Operating System :: Microsoft :: Windows", - "Operating System :: MacOS :: MacOS X", - "Topic :: Software Development :: Testing", - "Topic :: Software Development :: Quality Assurance", - "Topic :: Utilities", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], -) diff --git a/pytest_order/__init__.py b/src/pytest_order/__init__.py similarity index 100% rename from pytest_order/__init__.py rename to src/pytest_order/__init__.py diff --git a/pytest_order/item.py b/src/pytest_order/item.py similarity index 100% rename from pytest_order/item.py rename to src/pytest_order/item.py diff --git a/pytest_order/plugin.py b/src/pytest_order/plugin.py similarity index 100% rename from pytest_order/plugin.py rename to src/pytest_order/plugin.py diff --git a/pytest_order/settings.py b/src/pytest_order/settings.py similarity index 100% rename from pytest_order/settings.py rename to src/pytest_order/settings.py diff --git a/pytest_order/sorter.py b/src/pytest_order/sorter.py similarity index 100% rename from pytest_order/sorter.py rename to src/pytest_order/sorter.py diff --git a/tests/conftest.py b/tests/conftest.py index 8f2972f..fbfa5e8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ import pytest + from pytest_order.settings import Scope pytest_plugins = ["pytester"]