Skip to content

Commit fd10920

Browse files
committed
Move to py37-py310, proper type annotations and stop using cython
* backport logger pickup for `log_on_access` from `logwrap` * use modern pylint & mypy * use github actions for everything
1 parent 22c74c0 commit fd10920

File tree

16 files changed

+211
-676
lines changed

16 files changed

+211
-676
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 10 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ jobs:
5151
run: |
5252
python -m pip install --upgrade pip
5353
pip install --upgrade -r CI_REQUIREMENTS.txt
54-
pip install --upgrade "mypy >= 0.790"
54+
pip install --upgrade -r mypy_requirements.txt
5555
- name: Generate version file
5656
run: |
5757
python setup.py --version clean
5858
- name: Lint with MyPy
5959
run: |
60-
mypy --strict advanced_descriptors
60+
mypy --strict --install-types --non-interactive advanced_descriptors
6161
6262
Black:
6363
runs-on: ubuntu-latest
@@ -75,16 +75,15 @@ jobs:
7575
run: |
7676
black --check advanced_descriptors
7777
78-
TestScript:
78+
Test:
7979
needs: [PEP8, PyLint, MyPy, Black]
8080
runs-on: ${{ matrix.os }}
8181
strategy:
82-
max-parallel: 8
82+
max-parallel: 6
8383
matrix:
8484
os: [ubuntu-latest, windows-latest]
85-
python-version: [3.6, 3.7, 3.8, 3.9]
85+
python-version: [3.7, 3.8, 3.9]
8686

87-
name: "Script based python ${{ matrix.python-version }} on ${{ matrix.os }}"
8887
steps:
8988
- uses: actions/checkout@v2
9089
- name: Set up Python ${{ matrix.python-version }}
@@ -104,92 +103,20 @@ jobs:
104103
py.test --cov-report= --cov=advanced_descriptors test
105104
coverage report -m --fail-under 85
106105
107-
TestLinux:
108-
needs: [TestScript]
106+
Deploy:
107+
needs: [Test]
108+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
109109
runs-on: ubuntu-latest
110-
strategy:
111-
max-parallel: 4
112-
matrix:
113-
python-version: [3.6, 3.7, 3.8, 3.9]
114-
name: "Cython based python ${{ matrix.python-version }} on linux"
115-
116110
steps:
117111
- uses: actions/checkout@v2
118-
- name: Set up Python ${{ matrix.python-version }}
119-
uses: actions/setup-python@v2
120-
with:
121-
python-version: ${{ matrix.python-version }}
122-
- name: Install dependencies
123-
run: |
124-
python -m pip install --upgrade pip wheel
125-
pip install --upgrade -r CI_REQUIREMENTS.txt
126-
pip install --upgrade Cython
127-
pip install --upgrade -r pytest_requirements.txt
128-
- name: Build package and install
129-
run: |
130-
python setup.py bdist_wheel clean
131-
pip install advanced_descriptors --no-index -f dist
132-
- name: Test with pytest
133-
run: |
134-
py.test
135-
136-
TestWindows:
137-
needs: [TestScript]
138-
runs-on: windows-latest
139-
strategy:
140-
max-parallel: 8
141-
matrix:
142-
WINDOWS:
143-
- { ARCH: 'x86', WINDOWS: 'win32' }
144-
- { ARCH: 'x64', WINDOWS: 'win64' }
145-
python-version: [3.6, 3.7, 3.8, 3.9]
146-
name: "Cython based python ${{ matrix.python-version }} on ${{ matrix.WINDOWS.WINDOWS }}"
147-
148-
steps:
149-
- uses: actions/checkout@v2
150-
- name: Set up Python ${{ matrix.python-version }}
112+
- name: Set up Python
151113
uses: actions/setup-python@v2
152114
with:
153-
python-version: ${{ matrix.python-version }}
154-
architecture: ${{ matrix.WINDOWS.ARCH }}
115+
python-version: '3.x'
155116
- name: Install dependencies
156117
run: |
157118
python -m pip install --upgrade pip wheel
158119
pip install --upgrade -r CI_REQUIREMENTS.txt
159-
pip install --upgrade Cython
160-
pip install --upgrade -r pytest_requirements.txt
161-
- name: Build package and install
162-
run: |
163-
python setup.py bdist_wheel clean
164-
pip install advanced_descriptors --no-index -f dist
165-
- name: Test with pytest
166-
run: |
167-
py.test
168-
169-
DeployWindows:
170-
needs: [TestLinux, TestWindows]
171-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
172-
runs-on: windows-latest
173-
strategy:
174-
max-parallel: 6
175-
matrix:
176-
WINDOWS:
177-
- { ARCH: 'x86', WINDOWS: 'win32' }
178-
- { ARCH: 'x64', WINDOWS: 'win64' }
179-
python-version: [3.7, 3.8, 3.9]
180-
name: "Release for python ${{ matrix.python-version }} on ${{ matrix.WINDOWS.WINDOWS }}"
181-
182-
steps:
183-
- uses: actions/checkout@v2
184-
- name: Set up Python ${{ matrix.python-version }}
185-
uses: actions/setup-python@v2
186-
with:
187-
python-version: ${{ matrix.python-version }}
188-
architecture: ${{ matrix.WINDOWS.ARCH }}
189-
- name: Install dependencies
190-
run: |
191-
python -m pip install --upgrade pip wheel
192-
pip install --upgrade -r build_requirements.txt
193120
pip install --upgrade twine
194121
- name: Build package
195122
run: |
@@ -200,44 +127,3 @@ jobs:
200127
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
201128
run: |
202129
twine upload --skip-existing dist/*
203-
204-
# DeployManyLinux:
205-
# needs: [ TestLinux, TestWindows ]
206-
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
207-
# runs-on: ubuntu-latest
208-
# container:
209-
# image: ${{ matrix.MANYLINUX.CONTAINER }}
210-
# env:
211-
# PYTHONDONTWRITEBYTECODE: 1
212-
# strategy:
213-
# matrix:
214-
# PYTHON: [ "cp37-cp37m", "cp38-cp38", "cp39-cp39" ]
215-
# MANYLINUX:
216-
# - NAME: manylinux2010_x86_64
217-
# CONTAINER: "quay.io/pypa/manylinux2010_x86_64"
218-
# - NAME: manylinux2014_x86_64
219-
# CONTAINER: "quay.io/pypa/manylinux2014_x86_64"
220-
# name: "${{ matrix.PYTHON }} for ${{ matrix.MANYLINUX.NAME }}"
221-
# steps:
222-
# - uses: actions/checkout@v2
223-
# - name: Install main dependencies
224-
# run: |
225-
# /opt/python/${{ matrix.PYTHON }}/bin/python -m pip install -U pip wheel setuptools
226-
# /opt/python/${{ matrix.PYTHON }}/bin/pip install --upgrade -r build_requirements.txt
227-
# /opt/python/${{ matrix.PYTHON }}/bin/pip install --upgrade twine
228-
# - name: Build package
229-
# run: /opt/python/${{ matrix.PYTHON }}/bin/python setup.py bdist_wheel clean
230-
# - name: Bundle external shared libraries into the wheels
231-
# run: |
232-
# for whl in dist/*.whl; do
233-
# echo "Repairing $whl..."
234-
# auditwheel repair "$whl" -w dist/
235-
# done
236-
# - name: Cleanup OS specific wheels
237-
# run: rm -fv dist/*-linux_*.whl
238-
# - name: Deploy
239-
# env:
240-
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
241-
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
242-
# run: |
243-
# twine upload --skip-existing dist/*

.pylintrc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ load-plugins=pylint.extensions.docparams,
3333
pylint.extensions.overlapping_exceptions,
3434
pylint.extensions.emptystring,
3535
pylint.extensions.comparetozero,
36-
pylint.extensions.check_elif
36+
pylint.extensions.check_elif,
37+
pylint.extensions.code_style,
38+
pylint.extensions.redefined_variable_type,
39+
pylint.extensions.typing,
40+
pylint.extensions.empty_comment
3741

3842
# Pickle collected data for later comparisons.
3943
persistent=yes
@@ -67,9 +71,7 @@ confidence=
6771
# --disable=W".
6872
enable=all
6973

70-
disable=non-ascii-bytes-literal,
71-
raw-checker-failed,
72-
locally-disabled,
74+
disable=locally-disabled,
7375
file-ignored,
7476
suppressed-message,
7577
similarities,
@@ -84,7 +86,6 @@ disable=non-ascii-bytes-literal,
8486
too-many-instance-attributes,
8587
too-many-lines,
8688
misplaced-comparison-constant,
87-
bad-continuation,
8889
broad-except,
8990
logging-fstring-interpolation,
9091
logging-format-interpolation

0 commit comments

Comments
 (0)