Skip to content

Migrate from setup.cfg to pyproject.toml #971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 protected]>", email = "[email protected]" },
]
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"

Expand All @@ -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
90 changes: 16 additions & 74 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -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ć <[email protected]>
author_email = [email protected]
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