-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (120 loc) · 3.67 KB
/
pythonpackage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Python package
on: [push]
jobs:
PEP8:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade -r flake8_requirements.txt
- name: Lint with flake8
run: |
flake8 advanced_descriptors
PyLint:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade -r CI_REQUIREMENTS.txt
pip install --upgrade "pylint >= 2.6.0"
- name: Generate version file
run: |
python setup.py --version clean
- name: Lint with PyLint
run: |
pylint advanced_descriptors
MyPy:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade -r CI_REQUIREMENTS.txt
pip install --upgrade -r mypy_requirements.txt
- name: Generate version file
run: |
python setup.py --version clean
- name: Lint with MyPy
run: |
mypy --strict --install-types --non-interactive advanced_descriptors
Black:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade black regex
- name: Check code style with black
run: |
black --check advanced_descriptors
Test:
needs: [PEP8, PyLint, MyPy, Black]
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 6
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install --upgrade -r CI_REQUIREMENTS.txt
pip install --upgrade -r pytest_requirements.txt
- name: Build package and install develop
run: |
pip install -e .
- name: Test with pytest
run: |
py.test --cov-report= --cov=advanced_descriptors test
coverage report -m --fail-under 85
Deploy:
needs: [Test]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade twine build
- name: Build package
run: |
python -m build
- name: Deploy
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing dist/*