Skip to content

Commit

Permalink
build: Drop support for Python 3.6 (#1272)
Browse files Browse the repository at this point in the history
* Require Python 3.7+ for installation
* Remove Python 3.6 from testing in CI
* Remove Python 3.6 specific code from the codebase and metadata
  • Loading branch information
matthewfeickert authored Feb 11, 2021
1 parent 9d56349 commit bc32a69
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 18 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8]
exclude:
- os: macos-latest
python-version: 3.6
- os: macos-latest
python-version: 3.7

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8]
exclude:
- os: macos-latest
python-version: 3.6
- os: macos-latest
python-version: 3.7

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
rev: v2.10.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
args: ["--py37-plus"]
- repo: https://github.com/nbQA-dev/nbQA
rev: 0.5.7
hooks:
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,5 @@
"keywords": "physics fitting numpy scipy tensorflow pytorch jax",
"developmentStatus": "4 - Beta",
"applicationCategory": "Scientific/Engineering, Scientific/Engineering :: Physics",
"programmingLanguage": "Python 3, Python 3.6, Python 3.7, Python 3.8"
"programmingLanguage": "Python 3, Python 3.7, Python 3.8"
}
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"

[tool.black]
line-length = 88
target-version = ['py36', 'py37', 'py38']
target-version = ['py37', 'py38']
skip-string-normalization = true
include = '\.pyi?$'
exclude = '''
Expand Down Expand Up @@ -71,4 +71,4 @@ black = 1
pyupgrade = 1

[tool.nbqa.addopts]
pyupgrade = ["--py36-plus"]
pyupgrade = ["--py37-plus"]
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ classifiers =
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Physics
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8

Expand All @@ -33,7 +32,7 @@ package_dir =
= src
packages = find:
include_package_data = True
python_requires = >=3.6
python_requires = >=3.7
install_requires =
scipy~=1.4 # requires numpy, which is required by pyhf and tensorflow
click~=7.0 # for console scripts
Expand Down
2 changes: 1 addition & 1 deletion tests/test_optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def test_init_pars_sync_fixed_values_minuit(mocker):
minuit = mocker.patch.object(getattr(opt_minuit, 'iminuit'), 'Minuit')
minimizer = opt._get_minimizer(None, [9, 9, 9], [(0, 10)] * 3, fixed_vals=[(0, 1)])
assert minuit.called
# python 3.6 does not have ::args attribute on ::call_args
# python 3.7 does not have ::args attribute on ::call_args
# assert minuit.call_args.args[1] == [1, 9, 9]
assert minuit.call_args[0][1] == [1, 9, 9]
assert minimizer.fixed == [True, False, False]
Expand Down
6 changes: 1 addition & 5 deletions tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,8 @@ def test_patchset_download(datadir, script_runner, archive):
command = f'pyhf contrib download --verbose --force https://www.fail.org/record/resource/1234567 {datadir.join("likelihoods").strpath}'
ret = script_runner.run(*shlex.split(command))
assert not ret.success
# TODO: https://github.com/scikit-hep/pyhf/issues/1075
# Python 3.6 has different return error than 3.7, 3.8
assert (
"ssl.CertificateError: hostname 'www.fail.org' doesn't match"
or "certificate verify failed: Hostname mismatch, certificate is not valid for 'www.fail.org'."
in ret.stderr
"SSLCertificateError" and "hostname 'www.fail.org' doesn't match" in ret.stderr
)


Expand Down

0 comments on commit bc32a69

Please sign in to comment.