FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add linting checks into CI/CD · grumBit/python_packaging_example@d2fcc3c · GitHub

Commit d2fcc3c

Browse files
Graham Coster
committed
Add linting checks into CI/CD
1 parent 1f30286 commit d2fcc3c

3 files changed

Lines changed: 39 additions & 13 deletions

File tree

‎.github/workflows/publish-to-test-pypi.yml‎

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
1+
name: 🐍 → 🧪 → 🛠 → 📦 Test, build and publish Python packages to PyPI and TestPyPI
22

33
on: push
44

55
jobs:
66
build-n-publish:
7-
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
7+
name: 🐍 → 🧪 → 🛠 → 📦 Test, build and publish Python packages to PyPI and TestPyPI
88
runs-on: ubuntu-latest
99

1010
steps:
@@ -13,36 +13,53 @@ jobs:
1313
uses: actions/setup-python@v3
1414
with:
1515
python-version: "3.9"
16-
- name: Install requirements
16+
- name: 🛠 Install dev requirements
1717
run: >-
1818
python -m
1919
pip install
2020
--requirement requirements_dev.txt
21-
- name: Run tests
21+
--user
22+
- name: 🧪 Python linting
2223
run: >-
2324
python -m
24-
pytest
25-
- name: Install pypa/build
25+
pylint
26+
./src
27+
./tests
28+
- name: 🧪 Python format checking
2629
run: >-
2730
python -m
28-
pip install
29-
build
30-
--user
31-
- name: Build a binary wheel and a source tarball
31+
black
32+
./src
33+
./tests
34+
-l 120
35+
- name: 🧪 Python type checking
36+
run: >-
37+
python -m
38+
mypy
39+
--pretty
40+
--show-error-codes
41+
--show-error-context
42+
./src
43+
./tests
44+
- name: 🧪 Python testing
45+
run: >-
46+
python -m
47+
pytest
48+
- name: 🧰 Build binary wheel and source tarball
3249
run: >-
3350
python -m
3451
build
3552
--sdist
3653
--wheel
3754
--outdir dist/
38-
- name: Publish distribution 📦 to Test PyPI
55+
- name: 📦 Publish package to Test PyPI
3956
uses: pypa/gh-action-pypi-publish@release/v1
4057
with:
4158
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
4259
repository_url: https://test.pypi.org/legacy/
4360
verbose: true
4461
skip_existing: true
45-
- name: Publish distribution 📦 to PyPI
62+
- name: 📦 Publish package to PyPI
4663
if: startsWith(github.ref, 'refs/tags/v')
4764
uses: pypa/gh-action-pypi-publish@release/v1
4865
with:

‎requirements_dev.in‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-c requirements.txt
22
black
3+
build
34
mypy
45
pylint
56
pytest

‎requirements_dev.txt‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ attrs==22.1.0
1010
# via pytest
1111
black==22.8.0
1212
# via -r requirements_dev.in
13+
build==0.8.0
14+
# via -r requirements_dev.in
1315
click==8.1.3
1416
# via black
1517
coverage[toml]==6.4.4
@@ -31,9 +33,13 @@ mypy-extensions==0.4.3
3133
# black
3234
# mypy
3335
packaging==21.3
34-
# via pytest
36+
# via
37+
# build
38+
# pytest
3539
pathspec==0.10.1
3640
# via black
41+
pep517==0.13.0
42+
# via build
3743
platformdirs==2.5.2
3844
# via
3945
# black
@@ -55,8 +61,10 @@ pytest-cov==3.0.0
5561
tomli==2.0.1
5662
# via
5763
# black
64+
# build
5865
# coverage
5966
# mypy
67+
# pep517
6068
# pylint
6169
# pytest
6270
tomlkit==0.11.4

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL