diff --git a/pyproject.toml b/pyproject.toml index da02e5c0..24e7dc56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,62 @@ requires = [ "wheel>=0.36", ] +[project] +name = "pytest-asyncio" +description = "Pytest support for asyncio" +readme.content-type = "text/x-rst" +readme.file = "README.rst" +license.text = "Apache 2.0" +authors = [ + { name = "Tin Tvrtković ", email = "tinchester@gmail.com" }, +] +requires-python = ">=3.9" +classifiers = [ + "Development Status :: 4 - Beta", + "Framework :: AsyncIO", + "Framework :: Pytest", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3 :: Only", + "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", + "Topic :: Software Development :: Testing", + "Typing :: Typed", +] +dynamic = [ + "version", +] + +dependencies = [ + "pytest>=8.2,<9", +] +optional-dependencies.docs = [ + "sphinx>=5.3", + "sphinx-rtd-theme>=1", +] +optional-dependencies.testing = [ + "coverage>=6.2", + "hypothesis>=5.7.1", +] +urls."Bug Tracker" = "https://github.com/pytest-dev/pytest-asyncio/issues" +urls.Changelog = "https://pytest-asyncio.readthedocs.io/en/latest/reference/changelog.html" +urls.Documentation = "https://pytest-asyncio.readthedocs.io" +urls.Homepage = "https://github.com/pytest-dev/pytest-asyncio" +urls."Source Code" = "https://github.com/pytest-dev/pytest-asyncio" +entry-points.pytest11.asyncio = "pytest_asyncio.plugin" + +[tool.setuptools] +packages = [ + "pytest_asyncio", +] +include-package-data = true +license-files = [ + "LICENSE", +] + [tool.setuptools_scm] write_to = "pytest_asyncio/_version.py" @@ -17,3 +73,35 @@ lint.select = [ "F", # pyflakes "W", # pycodestyle ] + +[tool.pytest.ini_options] +python_files = [ + "test_*.py", + "*_example.py", +] +addopts = "-rsx --tb=short" +testpaths = [ + "docs", + "tests", +] +asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "function" +junit_family = "xunit2" +filterwarnings = [ + "error", + "ignore:The event_loop fixture provided by pytest-asyncio has been redefined.*:DeprecationWarning", +] + +[tool.coverage.run] +source = [ + "pytest_asyncio", +] +branch = true +data_file = "coverage/coverage" +omit = [ + "*/_version.py", +] +parallel = true + +[tool.coverage.report] +show_missing = true diff --git a/setup.cfg b/setup.cfg index 886b9d62..f68f54b8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,76 +1,18 @@ [metadata] -name = pytest-asyncio +# Not everything is in in pyproject.toml because of this issue: +; Traceback (most recent call last): +; File "/tmp/build-env-rud8b5r6/lib/python3.12/site-packages/setuptools/config/expand.py", line 69, in __getattr__ +; return next( +; ^^^^^ +;StopIteration +; +;The above exception was the direct cause of the following exception: +; +;Traceback (most recent call last): +; File "/tmp/build-env-rud8b5r6/lib/python3.12/site-packages/setuptools/config/expand.py", line 183, in read_attr +; return getattr(StaticModule(module_name, spec), attr_name) +; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +; File "/tmp/build-env-rud8b5r6/lib/python3.12/site-packages/setuptools/config/expand.py", line 75, in __getattr__ +; raise AttributeError(f"{self.name} has no attribute {attr}") from e +;AttributeError: pytest_asyncio has no attribute __version__ version = attr: pytest_asyncio.__version__ -url = https://github.com/pytest-dev/pytest-asyncio -project_urls = - Documentation = https://pytest-asyncio.readthedocs.io - Changelog = https://pytest-asyncio.readthedocs.io/en/latest/reference/changelog.html - Source Code = https://github.com/pytest-dev/pytest-asyncio - Bug Tracker = https://github.com/pytest-dev/pytest-asyncio/issues -description = Pytest support for asyncio -long_description = file: README.rst -long_description_content_type = text/x-rst -author = Tin Tvrtković -author_email = tinchester@gmail.com -license = Apache 2.0 -license_files = LICENSE -classifiers = - Development Status :: 4 - Beta - - Intended Audience :: Developers - - License :: OSI Approved :: Apache Software License - - 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 - - Topic :: Software Development :: Testing - - Framework :: AsyncIO - Framework :: Pytest - Typing :: Typed - -[options] -python_requires = >=3.9 -packages = pytest_asyncio -include_package_data = True - -# Always adjust requirements.txt and pytest-min-requirements.txt when changing runtime dependencies -install_requires = - pytest >= 8.2,<9 - -[options.extras_require] -testing = - coverage >= 6.2 - hypothesis >= 5.7.1 -docs = - sphinx >= 5.3 - sphinx-rtd-theme >= 1.0 - -[options.entry_points] -pytest11 = - asyncio = pytest_asyncio.plugin - -[coverage:run] -source = pytest_asyncio -branch = true -data_file = coverage/coverage -omit = */_version.py -parallel = true - -[coverage:report] -show_missing = true - -[tool:pytest] -python_files = test_*.py *_example.py -addopts = -rsx --tb=short -testpaths = docs tests -asyncio_mode = auto -asyncio_default_fixture_loop_scope = function -junit_family=xunit2 -filterwarnings = - error - ignore:The event_loop fixture provided by pytest-asyncio has been redefined.*:DeprecationWarning