Skip to content

Commit 7b4061f

Browse files
committed
push project forward
* CI py38/py39 * re-format * fix pylint * move coverage rules to pyproject.toml Signed-off-by: Aleksei Stepanov <[email protected]>
1 parent 6dd4910 commit 7b4061f

25 files changed

+242
-169
lines changed

.coveragerc

Lines changed: 0 additions & 38 deletions
This file was deleted.

.pydocstyle.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[pydocstyle]
2+
ignore =
3+
D401,
4+
# First line should be in imperative mood; try rephrasing
5+
D202,
6+
# No blank lines allowed after function docstring
7+
D203,
8+
# 1 blank line required before class docstring
9+
D213
10+
# Multi-line docstring summary should start at the second line
11+
match = (?!_version|test_)*.py

.pylintrc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extension-pkg-whitelist=
77

88
# Add files or directories to the blacklist. They should be base names, not
99
# paths.
10-
ignore=CVS
10+
ignore=CVS,.git
1111

1212
# Add files or directories matching the regex patterns to the blacklist. The
1313
# regex matches against base names, not paths.
@@ -30,7 +30,10 @@ limit-inference-results=100
3030
# usually to register additional checkers.
3131
load-plugins=pylint.extensions.docparams,
3232
pylint.extensions.docstyle,
33-
pylint.extensions.overlapping_exceptions
33+
pylint.extensions.overlapping_exceptions,
34+
pylint.extensions.emptystring,
35+
pylint.extensions.comparetozero,
36+
pylint.extensions.check_elif
3437

3538
# Pickle collected data for later comparisons.
3639
persistent=yes
@@ -69,7 +72,6 @@ disable=non-ascii-bytes-literal,
6972
locally-disabled,
7073
file-ignored,
7174
suppressed-message,
72-
comprehension-escape,
7375
similarities,
7476
too-many-ancestors,
7577
too-few-public-methods,
@@ -524,11 +526,11 @@ accept-no-raise-doc=no
524526

525527
# Whether to accept totally missing return documentation in the docstring of a
526528
# function that returns a statement.
527-
accept-no-return-doc=yes
529+
accept-no-return-doc=no
528530

529531
# Whether to accept totally missing yields documentation in the docstring of a
530532
# generator.
531-
accept-no-yields-doc=yes
533+
accept-no-yields-doc=no
532534

533535
# If the docstring type cannot be guessed the specified docstring type will be
534536
# used.

.travis.yml

Lines changed: 75 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
language: python
22
os: linux
3-
dist: xenial
4-
sudo: true
3+
dist: bionic
54

65
install:
76
- &upgrade_python_toolset pip install --upgrade pip setuptools wheel
8-
- &install_test_deps pip install --upgrade pytest pytest-sugar
7+
- &install_test_deps pip install --upgrade -r pytest_requirements.txt
98
- &install_deps pip install -r CI_REQUIREMENTS.txt
109
- pip install --upgrade pytest-cov coveralls
1110

@@ -19,10 +18,13 @@ _python:
1918
- &python38
2019
name: "Python 3.8"
2120
python: "3.8"
21+
- &python39
22+
name: "Python 3.9"
23+
python: "3.9"
2224

2325
_helpers:
2426
- &install_cython pip install --upgrade Cython
25-
- &build_package python setup.py bdist_wheel
27+
- &build_package python setup.py bdist_wheel clean
2628
- &install_built pip install threaded --no-index -f dist
2729
- &test_no_cov py.test -vvv test
2830
- &test_cythonized
@@ -36,24 +38,45 @@ _helpers:
3638
- *build_package
3739
- *install_built
3840
- *test_no_cov
39-
after_success: skip
4041

4142
- &static_analysis
4243
stage: Static analysis
43-
<<: *python37
44-
after_success: skip
44+
<<: *python38
4545

4646
- &code_style_check
4747
stage: Code style check
48-
<<: *python37
49-
after_success: skip
48+
<<: *python38
49+
50+
- &deploy
51+
<<: *python38
52+
if: tag IS present
53+
services:
54+
- docker
55+
install:
56+
- *upgrade_python_toolset
57+
- *install_deps
58+
- pip install -U --upgrade-strategy=eager --no-cache-dir twine
59+
before_deploy:
60+
- *build_package
61+
deploy:
62+
- provider: pypi
63+
# `skip_cleanup: true` is required to preserve binary wheels, built
64+
# inside of manylinux* docker container during `script` step above.
65+
cleanup: false
66+
skip_cleanup: true
67+
username: penguinolog
68+
password:
69+
secure: "h1gXulNJxdjdUtPXDwUf/2MltjjiTy/cSsv+67Bxr9PAXSo9s0ynnhijKavE0QlKPr0NDJcEcl79dEN3gx1rkbAFZ+YRJfx0KHy26ImNAIx+npOFjGko87KhMNkrE3QBn9carWNnjYA4rCuUqbv/Znk9xixleE/sHJbKnkkTrerSI2jkznMa6h0FNVCEPzFesHmll7rBy4CjFkRcWNX8nfKNIV9rHFI7mXm8+jzl0msOnkEcKRqAk+MUwVjcD9XtpF42uA0nQTtqjWFdwSUxxBJKMyrkkI0o8Uk06EewkgJGwjGpvn+EUm1hBpjGrXUQQJyr20SZdC0CqaqXD/axISAtQPzP5I4Ey3VkLDV4mZuQjeNlbRbTH0Q7af+CpnOpFtYobIs1/HjB5wztazegT8uk4ZU/GheYqknXmtg9Ga8NV47sIpLC/hTLXWP+O/k0JKRYP9CgjTml2nLykNjZy4KRnlCUerYH8d4bNz687ElXU2bLtlBxyigUc9oo31DvNG+vB2axOp8wGiRTEpfBVPEF6EYUj+qSbX4ep4o/mWp+ax5YlLVYVoXkXpNecIggICAChIkqEl9MtGzTu31s3sBKpk9WuqoyHG80TDo2Tet6zWYx3itUx9M0SLkrML9Hs5WKsXDZE6jZrVHtx8lWuuZZl5JQkXYtd358lwJmEBM="
70+
on:
71+
tags: true
72+
distributions: sdist
73+
upload_docs: false
74+
skip_existing: true
5075

5176
script:
5277
- python setup.py develop -v
5378
- py.test --cov-config .coveragerc --cov-report= --cov=threaded test
5479
- coverage report -m --fail-under 87
55-
after_success:
56-
- coveralls
5780

5881
jobs:
5982
include:
@@ -62,9 +85,10 @@ jobs:
6285
install:
6386
- *upgrade_python_toolset
6487
- *install_deps
65-
- pip install --upgrade "pylint >= 2.3" isort[pyproject,requirements]
88+
- pip install --upgrade "pylint >= 2.6.0"
6689
script:
67-
- python setup.py --version
90+
- python setup.py develop -v clean
91+
- python setup.py --version clean
6892
- pylint threaded
6993
- <<: *static_analysis
7094
name: "Bandit"
@@ -80,15 +104,15 @@ jobs:
80104
- *install_deps
81105
- pip install --upgrade "mypy >= 0.720"
82106
script:
83-
- python setup.py --version
107+
- python setup.py --version clean
84108
- mypy --strict threaded
85109
- <<: *static_analysis
86110
name: "PEP8"
87111
install:
88112
- *upgrade_python_toolset
89-
- pip install --upgrade flake8 flake8-bugbear
113+
- pip install --upgrade -r flake8_requirements.txt
90114
script:
91-
- flake8
115+
- flake8 threaded
92116

93117
# - <<: *code_style_check
94118
# name: "PEP257"
@@ -107,46 +131,58 @@ jobs:
107131

108132
- stage: test
109133
<<: *python36
134+
after_success:
135+
- coveralls
110136
- stage: test
111137
<<: *python37
138+
after_success:
139+
- coveralls
112140
- stage: test
113141
<<: *python38
142+
after_success:
143+
- coveralls
144+
- stage: test
145+
<<: *python39
146+
after_success:
147+
- coveralls
114148

115149
- <<: *test_cythonized
116150
<<: *python36
117151
- <<: *test_cythonized
118152
<<: *python37
119153
- <<: *test_cythonized
120154
<<: *python38
155+
- <<: *test_cythonized
156+
<<: *python39
121157

122158
- stage: deploy
123159
# This prevents job from appearing in test plan unless commit is tagged:
124-
if: tag IS present
125-
# Run on pypy to build not cythonized wheel
126-
<<: *python37
160+
<<: *deploy
127161
name: Build universal and cythonized bdist_wheel. Deploy bdist and sdist.
128-
services:
129-
- docker
130-
install:
131-
- *upgrade_python_toolset
132-
- *install_deps
133162
script:
134163
- ./tools/run_docker.sh "threaded"
135-
before_deploy:
136-
- *build_package
137-
deploy:
138-
- provider: pypi
139-
# `skip_cleanup: true` is required to preserve binary wheels, built
140-
# inside of manylinux1 docker container during `script` step above.
141-
skip_cleanup: true
142-
user: penguinolog
143-
password:
144-
secure: "h1gXulNJxdjdUtPXDwUf/2MltjjiTy/cSsv+67Bxr9PAXSo9s0ynnhijKavE0QlKPr0NDJcEcl79dEN3gx1rkbAFZ+YRJfx0KHy26ImNAIx+npOFjGko87KhMNkrE3QBn9carWNnjYA4rCuUqbv/Znk9xixleE/sHJbKnkkTrerSI2jkznMa6h0FNVCEPzFesHmll7rBy4CjFkRcWNX8nfKNIV9rHFI7mXm8+jzl0msOnkEcKRqAk+MUwVjcD9XtpF42uA0nQTtqjWFdwSUxxBJKMyrkkI0o8Uk06EewkgJGwjGpvn+EUm1hBpjGrXUQQJyr20SZdC0CqaqXD/axISAtQPzP5I4Ey3VkLDV4mZuQjeNlbRbTH0Q7af+CpnOpFtYobIs1/HjB5wztazegT8uk4ZU/GheYqknXmtg9Ga8NV47sIpLC/hTLXWP+O/k0JKRYP9CgjTml2nLykNjZy4KRnlCUerYH8d4bNz687ElXU2bLtlBxyigUc9oo31DvNG+vB2axOp8wGiRTEpfBVPEF6EYUj+qSbX4ep4o/mWp+ax5YlLVYVoXkXpNecIggICAChIkqEl9MtGzTu31s3sBKpk9WuqoyHG80TDo2Tet6zWYx3itUx9M0SLkrML9Hs5WKsXDZE6jZrVHtx8lWuuZZl5JQkXYtd358lwJmEBM="
145-
on:
146-
tags: true
147-
distributions: sdist
148-
skip_upload_docs: true
149-
skip_existing: true
164+
165+
- stage: deploy
166+
# This prevents job from appearing in test plan unless commit is tagged:
167+
<<: *deploy
168+
name: Build universal and cythonized for i686 bdist_wheel. Deploy bdist.
169+
script:
170+
- ./tools/run_docker_manylinux2014.sh "threaded" "i686"
171+
172+
- stage: deploy
173+
# This prevents job from appearing in test plan unless commit is tagged:
174+
<<: *deploy
175+
name: Build universal and cythonized for x86_64 bdist_wheel. Deploy bdist.
176+
script:
177+
- ./tools/run_docker_manylinux2014.sh "threaded" "x86_64"
178+
179+
- stage: deploy
180+
# This prevents job from appearing in test plan unless commit is tagged:
181+
<<: *deploy
182+
name: Build universal and cythonized for aarch64 bdist_wheel. Deploy bdist.
183+
arch: arm64
184+
script:
185+
- ./tools/run_docker_manylinux2014.sh "threaded" "aarch64"
150186

151187
cache: pip
152188
before_cache:

azure-pipelines.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- script: |
1616
python -m pip install --upgrade pip
17-
pip install -U setuptools
17+
pip install -U setuptools virtualenv
1818
pip install -r requirements.txt
1919
pip install -U pytest pytest-sugar pytest-flake8 flake8-bugbear flake8-docstrings
2020
displayName: 'Install dependencies'
@@ -41,14 +41,14 @@ jobs:
4141

4242
- script: |
4343
python -m pip install --upgrade pip
44-
pip install -U setuptools
44+
pip install -U setuptools virtualenv
4545
pip install -r requirements.txt
46-
pip install -U pytest pylint pylint_junit isort[pyproject,requirements]
46+
pip install -U pylint pylint_junit
4747
displayName: 'Install dependencies'
4848
4949
- script: |
50-
python setup.py --version
51-
displayName: 'Generate version file'
50+
python setup.py develop -v clean
51+
displayName: 'Install package develop mode'
5252
5353
- script: |
5454
pylint --output-format=pylint_junit.JUnitReporter threaded > pylint_result.xml
@@ -72,13 +72,13 @@ jobs:
7272

7373
- script: |
7474
python -m pip install --upgrade pip
75-
pip install -U setuptools
75+
pip install -U setuptools virtualenv
7676
pip install -r requirements.txt
77-
pip install -U "mypy>=0.700"
77+
pip install -U "mypy>=0.720"
7878
displayName: 'Install dependencies'
7979
8080
- script: |
81-
python setup.py --version
81+
python setup.py --version clean
8282
displayName: 'Generate version file'
8383
8484
- script: |
@@ -97,6 +97,8 @@ jobs:
9797
parameters: {name: 'Python_36', python: '3.6', architecture: 'x64', kind: 'native'}
9898
- template: .azure_pipelines/run_tests.yml
9999
parameters: {name: 'Python_37', python: '3.7', architecture: 'x64', kind: 'native'}
100+
- template: .azure_pipelines/run_tests.yml
101+
parameters: {name: 'Python_38', python: '3.8', architecture: 'x64', kind: 'native'}
100102

101103
- template: .azure_pipelines/run_tests.yml
102104
parameters: {name: 'Python_36', python: '3.6', architecture: 'x64', kind: 'cython'}
@@ -106,17 +108,23 @@ jobs:
106108
parameters: {name: 'Python_37', python: '3.7', architecture: 'x64', kind: 'cython'}
107109
- template: .azure_pipelines/run_tests.yml
108110
parameters: {name: 'Python_37', python: '3.7', architecture: 'x86', kind: 'cython'}
109-
111+
- template: .azure_pipelines/run_tests.yml
112+
parameters: {name: 'Python_38', python: '3.8', architecture: 'x64', kind: 'cython'}
113+
- template: .azure_pipelines/run_tests.yml
114+
parameters: {name: 'Python_38', python: '3.8', architecture: 'x86', kind: 'cython'}
110115

111116
- job: 'Build_and_deploy'
112117
dependsOn:
113118
- Python_36_x64_native
114119
- Python_37_x64_native
120+
- Python_38_x64_native
115121

116122
- Python_36_x64_cython
117123
- Python_36_x86_cython
118124
- Python_37_x64_cython
119125
- Python_37_x86_cython
126+
- Python_38_x64_cython
127+
- Python_38_x86_cython
120128
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
121129
pool:
122130
vmIMage: 'VS2017-Win2016'
@@ -135,6 +143,12 @@ jobs:
135143
Python37_x86:
136144
python.version: '3.7'
137145
python.architecture: 'x86'
146+
Python38_x64:
147+
python.version: '3.8'
148+
python.architecture: 'x64'
149+
Python38_x86:
150+
python.version: '3.8'
151+
python.architecture: 'x86'
138152

139153
steps:
140154
- task: UsePythonVersion@0
@@ -146,6 +160,7 @@ jobs:
146160
python -m pip install --upgrade pip
147161
pip install -U setuptools
148162
pip install -r build_requirements.txt
163+
pip install -U --upgrade-strategy=eager wheel
149164
displayName: 'Install dependencies'
150165
151166
- script: |

flake8_requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
flake8
2+
flake8-bugbear
3+
pep8-naming
4+
flake8-docstrings

0 commit comments

Comments
 (0)