Skip to content

Commit 6b4417e

Browse files
authored
Add setuptools scm (#128)
* add deploy workflow * update releasing steps for scm * add scp as dep * remove __version__ variable * add pyproject.toml * remove setup_requires
1 parent a8f0b3e commit 6b4417e

File tree

5 files changed

+33
-23
lines changed

5 files changed

+33
-23
lines changed

Diff for: .github/workflows/main.yml

+22
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,25 @@ jobs:
4545
- name: Lint
4646
run: |
4747
tox -e linting
48+
deploy:
49+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
50+
runs-on: ubuntu-latest
51+
needs: [build, linting]
52+
steps:
53+
- uses: actions/checkout@v2
54+
- name: Set up Python
55+
uses: actions/setup-python@v2
56+
with:
57+
python-version: "3.7"
58+
- name: Install wheel
59+
run: |
60+
python -m pip install --upgrade pip setuptools
61+
pip install wheel
62+
- name: Build package
63+
run: |
64+
python setup.py sdist bdist_wheel
65+
- name: Publish package to PyPI
66+
uses: pypa/gh-action-pypi-publish@master
67+
with:
68+
user: __token__
69+
password: ${{ secrets.pypi_token }}

Diff for: RELEASING.rst

+4-20
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,12 @@ Steps
2828

2929
$ tox
3030

31-
#. Install ``twine``
32-
33-
$ pip install twine
34-
3531
#. Commit and push the branch for review.
3632

37-
#. Once PR is **green** and **approved**, update `xprocess.__version__`::
38-
39-
#. Create source distribution and wheel
40-
41-
$ python setup.py sdist bdist_wheel
42-
43-
#. Check the created distribution files with twine
44-
45-
$ twine check dist/*
46-
47-
#. Release to test pypi to ensure everything is OK
48-
49-
$ twine upload -r <testpypi> dist/*
50-
51-
#. Finally, if everything looks fine on test pypi
33+
#. Once PR is **green** and **approved**, create and push a tag::
5234

53-
$ twine upload -r pypi dist
35+
$ export VERSION=X.Y.Z
36+
$ git tag $VERSION release-$VERSION
37+
$ git push [email protected]:pytest-dev/pytest-xprocess.git $VERSION
5438

5539
#. Merge ``release-X.Y.Z`` branch into master.

Diff for: pyproject.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=45.0",
4+
"setuptools-scm[toml]>=6.2.3",
5+
]
6+
7+
[tool.setuptools_scm]

Diff for: setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[metadata]
22
name = pytest-xprocess
3-
version = attr: xprocess.__version__
43
author = Holger Krekel
54
author_email = [email protected]
65
license = MIT

Diff for: xprocess/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@
99
"XProcessResources",
1010
"XProcessInfo",
1111
]
12-
13-
__version__ = "0.22.0"

0 commit comments

Comments
 (0)