Skip to content

Commit ecd668f

Browse files
committed
Unify deployment code with logwrap
1 parent 20cc39f commit ecd668f

File tree

15 files changed

+204
-109
lines changed

15 files changed

+204
-109
lines changed

.azure_pipelines/run_tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- script: |
2828
python -m pip install --upgrade pip
29-
pip install -U setuptools
29+
pip install -U setuptools virtualenv wheel
3030
displayName: upgrade pip and setuptools
3131
3232
- script: |
@@ -44,7 +44,7 @@ jobs:
4444
displayName: Build and install
4545
4646
- script: |
47-
pip install pytest pytest-sugar pytest-cov
47+
pip install pytest pytest-sugar pytest-cov coverage[toml]>=5.0
4848
4949
pytest --junitxml=unit_result.xml --cov=advanced_descriptors --cov-report=xml --cov-report=html --cov-report term test
5050
displayName: PyTest
@@ -62,4 +62,3 @@ jobs:
6262
inputs:
6363
codeCoverageTool: Cobertura
6464
summaryFileLocation: ${{ format('$(System.DefaultWorkingDirectory)/coverage.xml') }}
65-
reportDirectory: ${{ format('$(System.DefaultWorkingDirectory)/htmlcov') }}

.coveragerc

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

.github/workflows/pythonpackage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
max-parallel: 4
1111
matrix:
1212
os: [ubuntu-latest, windows-latest]
13-
python-version: [3.6, 3.7]
13+
python-version: [3.6, 3.7, 3.8]
1414

1515
steps:
1616
- uses: actions/checkout@v1
@@ -22,11 +22,11 @@ jobs:
2222
run: |
2323
python -m pip install --upgrade pip wheel
2424
pip install -r CI_REQUIREMENTS.txt
25-
pip install --upgrade pytest pytest-sugar pytest-cov
25+
pip install --upgrade pytest pytest-sugar pytest-cov coverage[toml]>=5.0
2626
- name: Build package and install develop
2727
run: |
2828
python setup.py develop -v
2929
- name: Test with pytest
3030
run: |
31-
py.test --cov-config .coveragerc --cov-report= --cov=advanced_descriptors test
31+
py.test --cov-report= --cov=advanced_descriptors test
3232
coverage report -m --fail-under 89

.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

.travis.yml

Lines changed: 67 additions & 34 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 pytest pytest-sugar coverage[toml]>=5.0
98
- &install_deps pip install -r CI_REQUIREMENTS.txt
109
- pip install --upgrade pytest-cov coveralls
1110

@@ -16,6 +15,9 @@ _python:
1615
- &python37
1716
name: "Python 3.7"
1817
python: "3.7"
18+
- &python38
19+
name: "Python 3.8"
20+
python: "3.8"
1921

2022
_helpers:
2123
- &install_cython pip install --upgrade Cython
@@ -33,24 +35,45 @@ _helpers:
3335
- *build_package
3436
- *install_built
3537
- *test_no_cov
36-
after_success: skip
3738

3839
- &static_analysis
3940
stage: Static analysis
4041
<<: *python37
41-
after_success: skip
4242

4343
- &code_style_check
4444
stage: Code style check
4545
<<: *python37
46-
after_success: skip
46+
47+
- &deploy
48+
<<: *python37
49+
if: tag IS present
50+
services:
51+
- docker
52+
install:
53+
- *upgrade_python_toolset
54+
- *install_deps
55+
- pip install -U --upgrade-strategy=eager --no-cache-dir twine
56+
before_deploy:
57+
- *build_package
58+
deploy:
59+
- provider: pypi
60+
# `skip_cleanup: true` is required to preserve binary wheels, built
61+
# inside of manylinux* docker container during `script` step above.
62+
cleanup: false
63+
skip_cleanup: true
64+
username: penguinolog
65+
password:
66+
secure: mG8p4UUzpz9wBdbif68NunjLp3rSED/OJw2Rh1nLBSSNcKtRBVEW4Gm/KYfHHc+kXVB66Nkda+T214kx4WhDk7lVRDKVu7ej0ze2mJX9iYmxhjOt7dcldostPAT8ZFfIvxEpS3UYGCPRbWTdOeeTe3wqz7/boVjC4DZu82nTarBJzApEn5ivtVHMs9bCedmk9Potb3FOiOscjkmEiKSllVQhgHnE/WPBOkfsaSaTCQKeTnqcCqJehNo4ki0cbmtAMpdPoR4DxAlHFK9jFD/W5Pm8s3UMkCer7vTwImINYICuibAIKEKcHdSHXOWJ6FoT21mJdgTWoZQGlAAKw8KV9R8dM6bNazV9iJbM3qUTUEJzyb08miRUf6iKxoPR1MpfqxuZ+ExGHfb0gX/Nu75aNxCSTbQ1YJD/oeXaqRQwpeGmW8vAXB9JSThfiEafymWMOKYuvgg0GPIP2RlLw7+zacfw9915VFiLpKSPrD48YU3p9jamIUeYb2aEDHpQK3rH4JUeAjdWV+a0mi0xWLjFzrVFc3R3jyUPAoxLNHLxzmb8+55pevA1JPUEYY2dolGBnZ7eXBAOIkHgEFlqqRxp4TLXoQR98eESYwrvaSV2YA11IuAJHF4bBI1pUfuUO7KiIDhacVi8VfNu5lAw8M1tInZk4aYLK6sw8L7XKq5hfZs=
67+
on:
68+
tags: true
69+
distributions: sdist
70+
upload_docs: false
71+
skip_existing: true
4772

4873
script:
4974
- python setup.py develop -v
50-
- py.test --cov-config .coveragerc --cov-report= --cov=advanced_descriptors test
75+
- py.test --cov-report= --cov=advanced_descriptors test
5176
- coverage report -m --fail-under 89
52-
after_success:
53-
- coveralls
5477

5578
jobs:
5679
include:
@@ -98,48 +121,58 @@ jobs:
98121
name: "Black formatting"
99122
install:
100123
- *upgrade_python_toolset
101-
- pip install --upgrade black
124+
- pip install --upgrade black regex
102125
script:
103126
- black --check advanced_descriptors
104127

105128
- stage: test
106129
<<: *python36
130+
after_success:
131+
- coveralls
107132
- stage: test
108133
<<: *python37
134+
after_success:
135+
- coveralls
136+
- stage: test
137+
<<: *python38
138+
after_success:
139+
- coveralls
109140

110141
- <<: *test_cythonized
111142
<<: *python36
112143
- <<: *test_cythonized
113144
<<: *python37
145+
- <<: *test_cythonized
146+
<<: *python38
114147

115148
- stage: deploy
116149
# This prevents job from appearing in test plan unless commit is tagged:
117-
if: tag IS present
118-
# Run on pypy to build not cythonized wheel
119-
<<: *python37
150+
<<: *deploy
120151
name: Build universal and cythonized bdist_wheel. Deploy bdist and sdist.
121-
services:
122-
- docker
123-
install:
124-
- *upgrade_python_toolset
125-
- *install_deps
126152
script:
127-
- ./tools/run_docker.sh "advanced_descriptors"
128-
before_deploy:
129-
- *build_package
130-
deploy:
131-
- provider: pypi
132-
# `skip_cleanup: true` is required to preserve binary wheels, built
133-
# inside of manylinux1 docker container during `script` step above.
134-
skip_cleanup: true
135-
user: penguinolog
136-
password:
137-
secure: "mG8p4UUzpz9wBdbif68NunjLp3rSED/OJw2Rh1nLBSSNcKtRBVEW4Gm/KYfHHc+kXVB66Nkda+T214kx4WhDk7lVRDKVu7ej0ze2mJX9iYmxhjOt7dcldostPAT8ZFfIvxEpS3UYGCPRbWTdOeeTe3wqz7/boVjC4DZu82nTarBJzApEn5ivtVHMs9bCedmk9Potb3FOiOscjkmEiKSllVQhgHnE/WPBOkfsaSaTCQKeTnqcCqJehNo4ki0cbmtAMpdPoR4DxAlHFK9jFD/W5Pm8s3UMkCer7vTwImINYICuibAIKEKcHdSHXOWJ6FoT21mJdgTWoZQGlAAKw8KV9R8dM6bNazV9iJbM3qUTUEJzyb08miRUf6iKxoPR1MpfqxuZ+ExGHfb0gX/Nu75aNxCSTbQ1YJD/oeXaqRQwpeGmW8vAXB9JSThfiEafymWMOKYuvgg0GPIP2RlLw7+zacfw9915VFiLpKSPrD48YU3p9jamIUeYb2aEDHpQK3rH4JUeAjdWV+a0mi0xWLjFzrVFc3R3jyUPAoxLNHLxzmb8+55pevA1JPUEYY2dolGBnZ7eXBAOIkHgEFlqqRxp4TLXoQR98eESYwrvaSV2YA11IuAJHF4bBI1pUfuUO7KiIDhacVi8VfNu5lAw8M1tInZk4aYLK6sw8L7XKq5hfZs="
138-
on:
139-
tags: true
140-
distributions: sdist
141-
skip_upload_docs: true
142-
skip_existing: true
153+
- ./tools/run_docker.sh advanced_descriptors
154+
155+
- stage: deploy
156+
# This prevents job from appearing in test plan unless commit is tagged:
157+
<<: *deploy
158+
name: Build universal and cythonized for i686 bdist_wheel. Deploy bdist.
159+
script:
160+
- ./tools/run_docker_manylinux2014.sh advanced_descriptors "i686"
161+
162+
- stage: deploy
163+
# This prevents job from appearing in test plan unless commit is tagged:
164+
<<: *deploy
165+
name: Build universal and cythonized for x86_64 bdist_wheel. Deploy bdist.
166+
script:
167+
- ./tools/run_docker_manylinux2014.sh advanced_descriptors "x86_64"
168+
169+
- stage: deploy
170+
# This prevents job from appearing in test plan unless commit is tagged:
171+
<<: *deploy
172+
name: Build universal and cythonized for aarch64 bdist_wheel. Deploy bdist.
173+
arch: arm64
174+
script:
175+
- ./tools/run_docker_manylinux2014.sh advanced_descriptors "aarch64"
143176

144177
cache: pip
145178
before_cache:

azure-pipelines.yml

Lines changed: 19 additions & 3 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,7 +41,7 @@ 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
4646
pip install -U pytest pylint pylint_junit isort[pyproject,requirements]
4747
displayName: 'Install dependencies'
@@ -74,7 +74,7 @@ jobs:
7474
python -m pip install --upgrade pip
7575
pip install -U setuptools
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: |
@@ -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,16 +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'}
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'}
109115

110116
- job: 'Build_and_deploy'
111117
dependsOn:
112118
- Python_36_x64_native
113119
- Python_37_x64_native
120+
- Python_38_x64_native
114121

115122
- Python_36_x64_cython
116123
- Python_36_x86_cython
117124
- Python_37_x64_cython
118125
- Python_37_x86_cython
126+
- Python_38_x64_cython
127+
- Python_38_x86_cython
119128
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
120129
pool:
121130
vmIMage: 'VS2017-Win2016'
@@ -134,6 +143,12 @@ jobs:
134143
Python37_x86:
135144
python.version: '3.7'
136145
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'
137152

138153
steps:
139154
- task: UsePythonVersion@0
@@ -145,6 +160,7 @@ jobs:
145160
python -m pip install --upgrade pip
146161
pip install -U setuptools
147162
pip install -r build_requirements.txt
163+
pip install -U --upgrade-strategy=eager wheel
148164
displayName: 'Install dependencies'
149165
150166
- script: |

build_requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Cython; platform_python_implementation == "CPython"
2-
wheel==0.31.1
32
-r CI_REQUIREMENTS.txt

pyproject.toml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,46 @@ force_single_line = true
2020

2121
import_heading_stdlib = "Standard Library"
2222
import_heading_thirdparty = "External Dependencies"
23-
import_heading_firstparty = "Advanced Descriptors Implementation"
23+
import_heading_firstparty = "Package Implementation"
2424
import_heading_localfolder = "Local Implementation"
25+
26+
[tool.coverage.run]
27+
omit = ["test/*"]
28+
branch = true
29+
30+
[tool.coverage.report]
31+
exclude_lines = [
32+
# Have to re-enable the standard pragma
33+
"pragma: no cover",
34+
35+
# Don't complain about missing debug-only code:
36+
"def __repr__",
37+
38+
# Don't complain if tests don't hit defensive assertion code:
39+
"raise NotImplementedError",
40+
41+
# Exclude methods marked as abstract
42+
"@abstractmethod",
43+
44+
# Exclude import statements
45+
"^from\b",
46+
"^import\b",
47+
48+
# Exclude variable declarations that are executed when file is loaded
49+
"^[a-zA-Z_]+\b\\s=",
50+
51+
# Code for static analysis is never covered:
52+
"if typing.TYPE_CHECKING:",
53+
54+
# Fallback code with no installed deps is almost impossible to cover properly
55+
"except ImportError:",
56+
57+
# Don't complain if non-runnable code isn't run:
58+
"if __name__ == .__main__.:",
59+
60+
# OS Specific
61+
"if platform.system()",
62+
]
63+
64+
[tool.coverage.json]
65+
pretty_print = true

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
addopts = -vvv -s -p no:django -p no:ipdb
33
testpaths = test
44
mock_use_standalone_module = false
5+
junit_family = xunit2

0 commit comments

Comments
 (0)