Skip to content

Commit b5ed617

Browse files
chore: added semantic versioning
1 parent d98f19a commit b5ed617

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

.github/workflows/pytest-rts.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,20 @@ jobs:
3030
run: |
3131
pip install tox
3232
tox -e py -- --exitfirst
33+
34+
release:
35+
needs: test
36+
if: github.ref == 'refs/heads/master'
37+
name: Publish
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v2
43+
with:
44+
fetch-depth: 0
45+
46+
- name: Publish
47+
env:
48+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
run: make install publish

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ $(VENV_DIR)/bin/activate: setup.py
66
test -d $(VENV_DIR) || python3 -m venv $(VENV_DIR)
77

88
install: venv
9-
$(PYTHON) setup.py develop
9+
$(PYTHON) -m pip install -e .[dev]
1010

1111
clean:
1212
rm -rf $(VENV_DIR)
1313
rm -rf pytest_rts.egg-info
14+
15+
publish:
16+
semantic-release publish -D \
17+
version_variable=pytest_rts/__init__.py:__version__ \
18+
upload_to_pypi=false \
19+
upload_to_release=false

pytest_rts/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
"""pytest-rts: avoid already imported warning: PYTEST_DONT_REWRITE"""
2+
__version__ = "1.0.0"

setup.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
from setuptools import setup, find_packages # type: ignore
77

88

9-
GIT_VERSION = (
10-
subprocess.check_output("git describe --always".split()).strip().decode("ascii")
11-
)
12-
TESTS_REQUIRE = ["pytest-cov", "pytest-socket", "tox"]
13-
DEV_REQUIRE = ["black", "mypy", "pylint", "safety"]
9+
GIT_VERSION = subprocess.check_output("git describe --always".split()).strip().decode("ascii")
10+
DEV_REQUIRE = ["pytest-cov", "pytest-socket", "tox", "python-semantic-release", "black", "mypy", "pylint", "safety"]
1411

1512
# pylint: disable=line-too-long
1613
setup(
@@ -30,7 +27,6 @@
3027
},
3128
install_requires=["pydriller", "coverage", "pytest"],
3229
extras_require={
33-
"tests": TESTS_REQUIRE,
3430
"dev": TESTS_REQUIRE + DEV_REQUIRE,
3531
},
3632
)

0 commit comments

Comments
 (0)