Skip to content

Commit 41420cf

Browse files
authored
Switch to declarative setup (#247)
* Switch to declarative setup * Use __main__ guard * Add build-backend * Pin versions
1 parent 4176c3d commit 41420cf

File tree

3 files changed

+57
-49
lines changed

3 files changed

+57
-49
lines changed

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=51.0",
4+
"wheel>=0.36",
5+
]
6+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1+
[metadata]
2+
name = pytest-asyncio
3+
version = attr: pytest_asyncio.__version__
4+
url = https://github.com/pytest-dev/pytest-asyncio
5+
project_urls =
6+
GitHub = https://github.com/pytest-dev/pytest-asyncio
7+
description = Pytest support for asyncio
8+
long_description = file: README.rst
9+
long_description_content_type = text/x-rst
10+
author = Tin Tvrtković <[email protected]>
11+
author_email = [email protected]
12+
license = Apache 2.0
13+
license_file = LICENSE
14+
classifiers =
15+
Development Status :: 4 - Beta
16+
17+
Intended Audience :: Developers
18+
19+
License :: OSI Approved :: Apache Software License
20+
21+
Programming Language :: Python :: 3.7
22+
Programming Language :: Python :: 3.8
23+
Programming Language :: Python :: 3.9
24+
Programming Language :: Python :: 3.10
25+
26+
Topic :: Software Development :: Testing
27+
28+
Framework :: Asyncio
29+
Framework :: Pytest
30+
31+
[options]
32+
python_requires = >=3.7
33+
packages = find:
34+
include_package_data = True
35+
36+
install_requires =
37+
pytest >= 5.4.0
38+
39+
[options.extras_require]
40+
testing =
41+
coverage
42+
hypothesis >= 5.7.1
43+
flaky >= 3.5.0
44+
45+
[options.entry_points]
46+
pytest11 =
47+
asyncio = pytest_asyncio.plugin
48+
149
[coverage:run]
250
source = pytest_asyncio
351

@@ -10,9 +58,5 @@ testpaths = tests
1058
asyncio_mode = auto
1159
filterwarnings = error
1260

13-
[metadata]
14-
# ensure LICENSE is included in wheel metadata
15-
license_file = LICENSE
16-
1761
[flake8]
1862
max-line-length = 88

setup.py

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,4 @@
1-
import re
2-
from pathlib import Path
1+
from setuptools import setup
32

4-
from setuptools import find_packages, setup
5-
6-
7-
def find_version():
8-
version_file = (
9-
Path(__file__).parent.joinpath("pytest_asyncio", "__init__.py").read_text()
10-
)
11-
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
12-
if version_match:
13-
return version_match.group(1)
14-
15-
raise RuntimeError("Unable to find version string.")
16-
17-
18-
setup(
19-
name="pytest-asyncio",
20-
version=find_version(),
21-
packages=find_packages(),
22-
url="https://github.com/pytest-dev/pytest-asyncio",
23-
license="Apache 2.0",
24-
author="Tin Tvrtković",
25-
author_email="[email protected]",
26-
description="Pytest support for asyncio.",
27-
long_description=Path(__file__).parent.joinpath("README.rst").read_text(),
28-
classifiers=[
29-
"Development Status :: 4 - Beta",
30-
"Intended Audience :: Developers",
31-
"License :: OSI Approved :: Apache Software License",
32-
"Programming Language :: Python :: 3.7",
33-
"Programming Language :: Python :: 3.8",
34-
"Programming Language :: Python :: 3.9",
35-
"Programming Language :: Python :: 3.10",
36-
"Topic :: Software Development :: Testing",
37-
"Framework :: Asyncio",
38-
"Framework :: Pytest",
39-
],
40-
python_requires=">= 3.7",
41-
install_requires=["pytest >= 5.4.0"],
42-
extras_require={
43-
"testing": ["coverage", "hypothesis >= 5.7.1", "flaky >= 3.5.0"],
44-
},
45-
entry_points={"pytest11": ["asyncio = pytest_asyncio.plugin"]},
46-
)
3+
if __name__ == "__main__":
4+
setup()

0 commit comments

Comments
 (0)