Skip to content

Commit 8250e3f

Browse files
committed
add pre-commit
1 parent a51463b commit 8250e3f

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

.github/workflows/python-publish.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ jobs:
1515
name: Code QA
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
19-
- run: pip install black flake8 isort
20-
- run: black --version
21-
- run: isort --version
22-
- run: flake8 --version
23-
- run: isort --check .
24-
- run: black --check .
25-
- run: flake8 .
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: 3.x
22+
- uses: pre-commit/[email protected]
23+
env:
24+
SKIP: no-commit-to-branch
2625

2726
checks:
2827
if: ${{ github.event_name == 'release' }}
@@ -66,24 +65,17 @@ jobs:
6665
- name: Set up Python
6766
uses: actions/setup-python@v2
6867
with:
69-
python-version: '3.10'
70-
71-
- name: Check that tag version matches code version
72-
run: |
73-
tag=${GITHUB_REF#refs/tags/}
74-
version=$(python setup.py --version)
75-
echo 'tag='$tag
76-
echo "version file="$version
77-
test "$tag" == "$version"
68+
python-version: '3.x'
7869

7970
- name: Install dependencies
8071
run: |
8172
python -m pip install --upgrade pip
82-
pip install setuptools wheel twine
73+
pip install build wheel twine
8374
- name: Build and publish
8475
env:
8576
TWINE_USERNAME: __token__
8677
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
8778
run: |
88-
python setup.py sdist
79+
python -m pip install --upgrade build
80+
python -m build
8981
twine upload dist/*

0 commit comments

Comments
 (0)