Skip to content

Commit 59c6a88

Browse files
authored
Add support for Python 3.10 (#114)
* drop Python 3.6 on MacOS * update pre-commits, flake8, isort, black * update setup layout towards setup.cfg * update dependencies closes #112, closes #113
1 parent 8e6a4ce commit 59c6a88

File tree

8 files changed

+75
-46
lines changed

8 files changed

+75
-46
lines changed

.azure-pipelines.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,26 @@ stages:
1515
pool:
1616
vmImage: ubuntu-latest
1717
steps:
18-
# Use Python >=3.7 for syntax validation
18+
# Run syntax validation using oldest and latest Python
1919
- task: UsePythonVersion@0
2020
displayName: Set up python
2121
inputs:
22-
versionSpec: 3.7
22+
versionSpec: 3.6
2323

24-
# Run syntax validation on a shallow clone
25-
- bash: |
26-
python .azure-pipelines/syntax-validation.py
27-
displayName: Syntax validation
24+
- bash: python .azure-pipelines/syntax-validation.py
25+
displayName: Syntax validation (3.6)
26+
27+
- task: UsePythonVersion@0
28+
displayName: Set up python
29+
inputs:
30+
versionSpec: 3.10
31+
32+
- bash: python .azure-pipelines/syntax-validation.py
33+
displayName: Syntax validation (3.10)
2834

29-
# Run flake8 validation on a shallow clone
35+
# Run flake8 validation
3036
- bash: |
31-
pip install flake8
37+
pip install --disable-pip-version-check flake8 && \
3238
python .azure-pipelines/flake8-validation.py
3339
displayName: Flake8 validation
3440
@@ -48,6 +54,8 @@ stages:
4854
PYTHON_VERSION: 3.8
4955
python39:
5056
PYTHON_VERSION: 3.9
57+
python310:
58+
PYTHON_VERSION: 3.10
5159
steps:
5260
- template: .azure-pipelines/ci.yml
5361

@@ -56,14 +64,14 @@ stages:
5664
vmImage: macOS-latest
5765
strategy:
5866
matrix:
59-
python36:
60-
PYTHON_VERSION: 3.6
6167
python37:
6268
PYTHON_VERSION: 3.7
6369
python38:
6470
PYTHON_VERSION: 3.8
6571
python39:
6672
PYTHON_VERSION: 3.9
73+
python310:
74+
PYTHON_VERSION: 3.10
6775
steps:
6876
- template: .azure-pipelines/ci.yml
6977

@@ -80,6 +88,8 @@ stages:
8088
PYTHON_VERSION: 3.8
8189
python39:
8290
PYTHON_VERSION: 3.9
91+
python310:
92+
PYTHON_VERSION: 3.10
8393
steps:
8494
- template: .azure-pipelines/ci.yml
8595

@@ -98,7 +108,7 @@ stages:
98108
- task: UsePythonVersion@0
99109
displayName: Set up python
100110
inputs:
101-
versionSpec: 3.8
111+
versionSpec: 3.9
102112

103113
- bash: |
104114
python -m pip install -r requirements_dev.txt

.azure-pipelines/flake8-validation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
[
99
"flake8",
1010
"--exit-zero",
11-
"--max-line-length=88",
12-
"--select=E401,E711,E712,E713,E714,E721,E722,E901,F401,F402,F403,F405,F631,F632,F633,F811,F812,F821,F822,F841,F901,W191,W291,W292,W293,W602,W603,W604,W605,W606",
1311
],
1412
capture_output=True,
1513
check=True,

.bumpversion.cfg

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ current_version = 2.3.0
33
commit = True
44
tag = True
55

6-
[bumpversion:file:setup.py]
7-
search = version="{current_version}"
8-
replace = version="{new_version}"
6+
[bumpversion:file:setup.cfg]
7+
search = version = {current_version}
8+
replace = version = {new_version}
99

1010
[bumpversion:file:procrunner/__init__.py]
1111
search = __version__ = "{current_version}"
1212
replace = __version__ = "{new_version}"
13-

.pre-commit-config.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,31 @@ repos:
22

33
# Automatically sort imports
44
- repo: https://github.com/PyCQA/isort
5-
rev: 5.6.4
5+
rev: 5.9.3
66
hooks:
77
- id: isort
88

99
# Automatic source code formatting
1010
- repo: https://github.com/psf/black
11-
rev: 21.4b2
11+
rev: 21.6b0
1212
hooks:
1313
- id: black
1414
args: [--safe, --quiet]
1515

16-
# Syntax check and some basic flake8
16+
# Linting
17+
- repo: https://github.com/PyCQA/flake8
18+
rev: 3.9.2
19+
hooks:
20+
- id: flake8
21+
additional_dependencies: ['flake8-comprehensions==3.5.0']
22+
23+
# Syntax validation and some basic sanity checks
1724
- repo: https://github.com/pre-commit/pre-commit-hooks
18-
rev: v2.0.0
25+
rev: v4.0.1
1926
hooks:
27+
- id: check-merge-conflict
2028
- id: check-ast
2129
- id: check-json
30+
- id: check-added-large-files
31+
args: ['--maxkb=200']
2232
- id: check-yaml
23-
- id: flake8
24-
args: ['--max-line-length=88', '--select=E401,E711,E712,E713,E714,E721,E722,E901,F401,F402,F403,F405,F631,F632,F633,F811,F812,F821,F822,F841,F901,W191,W291,W292,W293,W602,W603,W604,W605,W606']
25-
- id: check-merge-conflict

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018 Diamond Light Source.
1+
Copyright (c) 2018-2021 Diamond Light Source.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

requirements_dev.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
bump2version==1.0.1
2-
coverage==5.5
3-
flake8==3.9.2
4-
pip==21.2.4
2+
coverage==6.0.2
3+
pip==21.3.1
54
pytest==6.2.5
65
Sphinx==4.2.0
76
tox==3.24.4

setup.cfg

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,44 @@
11
[metadata]
2+
name = procrunner
3+
description = Versatile utility function to run external processes
4+
version = 2.3.0
5+
classifiers =
6+
Development Status :: 5 - Production/Stable
7+
Intended Audience :: Developers
8+
License :: OSI Approved :: BSD License
9+
Natural Language :: English
10+
Programming Language :: Python :: 3
11+
Programming Language :: Python :: 3.6
12+
Programming Language :: Python :: 3.7
13+
Programming Language :: Python :: 3.8
14+
Programming Language :: Python :: 3.9
15+
Programming Language :: Python :: 3.10
16+
Operating System :: OS Independent
17+
Topic :: Software Development :: Libraries :: Python Modules
18+
license = BSD
19+
license_file = LICENSE
220
project-urls =
21+
Download = https://github.com/DiamondLightSource/python-procrunner/tags
322
Documentation = https://procrunner.readthedocs.io/
423
GitHub = https://github.com/DiamondLightSource/python-procrunner
524
Bug-Tracker = https://github.com/DiamondLightSource/python-procrunner/issues
625

726
[flake8]
8-
exclude = docs
27+
# Black disagrees with flake8 on a few points. Ignore those.
28+
ignore = E203, E266, E501, W503
29+
# E203 whitespace before ':'
30+
# E266 too many leading '#' for block comment
31+
# E501 line too long
32+
# W503 line break before binary operator
33+
34+
max-line-length = 88
35+
36+
select =
37+
E401,E711,E712,E713,E714,E721,E722,E901,
38+
F401,F402,F403,F405,F541,F631,F632,F633,F811,F812,F821,F822,F841,F901,
39+
W191,W291,W292,W293,W602,W603,W604,W605,W606,
40+
# flake8-comprehensions, https://github.com/adamchainz/flake8-comprehensions
41+
C4,
942

1043
[aliases]
1144
test = pytest

setup.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,15 @@
1818
setup(
1919
author="Markus Gerstel",
2020
author_email="[email protected]",
21-
classifiers=[
22-
"Development Status :: 5 - Production/Stable",
23-
"Intended Audience :: Developers",
24-
"License :: OSI Approved :: BSD License",
25-
"Natural Language :: English",
26-
"Operating System :: OS Independent",
27-
"Programming Language :: Python :: 3",
28-
"Programming Language :: Python :: 3.6",
29-
"Programming Language :: Python :: 3.7",
30-
"Programming Language :: Python :: 3.8",
31-
"Programming Language :: Python :: 3.9",
32-
"Topic :: Software Development :: Libraries :: Python Modules",
33-
],
34-
description="Versatile utility function to run external processes",
3521
install_requires=requirements,
36-
license="BSD license",
3722
long_description=readme + "\n\n" + history,
3823
include_package_data=True,
3924
keywords="procrunner",
40-
name="procrunner",
4125
packages=find_packages(include=["procrunner"]),
4226
python_requires=">=3.6",
4327
setup_requires=setup_requirements,
4428
test_suite="tests",
4529
tests_require=test_requirements,
4630
url="https://github.com/DiamondLightSource/python-procrunner",
47-
version="2.3.0",
4831
zip_safe=False,
4932
)

0 commit comments

Comments
 (0)