Skip to content

Commit 37ec756

Browse files
imranitymalikinicoddemusseifertmasvetlov
authored
Switch to setuptools-scm for versioning (#37)
* Switch to setuptools-scm for versioning Following other pytest projects like pytest-html, that use setuptool-scm to manage version, it would be nice other projects follow the suit and let setuptools-scm manage version of this project. * Update .gitignore * ci: Install dependency setuptools_scm. Signed-off-by: Michael Seifert <[email protected]> * Drop explicit version reference from setup.cfg * Remove setuptools_scm and wheel from `pip install --upgrade` of the test job Co-authored-by: Andrew Svetlov <[email protected]> * Replace `setuptools_scm` and `wheel` with `build`in package job Co-authored-by: Andrew Svetlov <[email protected]> * Change the packaging command to use `build` Co-authored-by: Andrew Svetlov <[email protected]> * build: Added missing dependency declaration on setuptools_scm to setup.cfg. This prevents tools relying on setuptools from picking up the dependency correctly. Signed-off-by: Michael Seifert <[email protected]> * build: Added version in metadata. Signed-off-by: Michael Seifert <[email protected]> Co-authored-by: maliki <[email protected]> Co-authored-by: Bruno Oliveira <[email protected]> Co-authored-by: Michael Seifert <[email protected]> Co-authored-by: Andrew Svetlov <[email protected]>
1 parent f0c20dc commit 37ec756

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
set -xe
3030
python -VV
3131
python -m site
32-
python -m pip install --upgrade pip wheel
32+
python -m pip install --upgrade pip
3333
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
3434
- name: "Run tox targets for ${{ matrix.python-version }}"
3535
run: "python -m tox"
@@ -57,9 +57,9 @@ jobs:
5757
python-version: "3.9"
5858

5959
- name: "Install poetry, check-wheel-content, and twine"
60-
run: "python -m pip install wheel twine check-wheel-contents"
60+
run: "python -m pip install build check-wheel-contents twine"
6161
- name: "Build package"
62-
run: "python setup.py sdist bdist_wheel"
62+
run: "python -m build"
6363
- name: "List result"
6464
run: "ls -l dist"
6565
- name: "Check wheel contents"

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ htmlcov/
3939
.tox/
4040
.coverage
4141
.coverage.*
42-
.cache
42+
.pytest_cache
4343
nosetests.xml
4444
coverage.xml
4545
*,cover
@@ -63,3 +63,7 @@ target/
6363

6464
# pyenv
6565
.python-version
66+
67+
68+
# generated by setuptools_scm
69+
pytest_asyncio/_version.py

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
requires = [
33
"setuptools>=51.0",
44
"wheel>=0.36",
5+
"setuptools_scm>=6.2"
56
]
67
build-backend = "setuptools.build_meta"
8+
9+
[tool.setuptools_scm]
10+
write_to = "pytest_asyncio/_version.py"

pytest_asyncio/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""The main point for importing pytest-asyncio items."""
2-
__version__ = "0.16.0"
3-
2+
from ._version import version as __version__ # noqa
43
from .plugin import fixture
54

65
__all__ = ("fixture",)

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ python_requires = >=3.7
3333
packages = find:
3434
include_package_data = True
3535

36+
setup_requires =
37+
setuptools_scm >= 6.2
38+
3639
install_requires =
3740
pytest >= 5.4.0
3841

0 commit comments

Comments
 (0)