Skip to content

Commit 86fc5ef

Browse files
authored
chore: drop Python 2.7 & 3.5 (#29)
* chore: drop Python 2 (mostly via pyupgrade) * chore: dropping Python 2 style type comments * fix: support 3.6 again * ci: update build a bit * docs: drop Python 2 from the readme
1 parent c0ff38d commit 86fc5ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+70
-204
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
python-version:
18-
- 2.7
1918
- 3.6
2019
- 3.8
2120
- 3.9
@@ -51,16 +50,12 @@ jobs:
5150
run: python -m pytest tests/root_tests -ra
5251

5352
dist:
54-
runs-on: ubuntu-latest
53+
runs-on: ubuntu-20.04
5554
steps:
5655
- uses: actions/checkout@v1
57-
- uses: actions/setup-python@v2
58-
59-
- name: Install wheel and sdist requirements
60-
run: python -m pip install "build"
6156

6257
- name: Build sdist and wheel
63-
run: python -m build
58+
run: pipx run --spec build pyproject-build
6459

6560
- uses: actions/upload-artifact@v2
6661
with:

.pre-commit-config.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
repos:
2+
- repo: https://github.com/asottile/pyupgrade
3+
rev: v2.10.0
4+
hooks:
5+
- id: pyupgrade
6+
args: [--py36-plus]
7+
28
- repo: https://github.com/psf/black
39
rev: 20.8b1
410
hooks:
@@ -18,13 +24,6 @@ repos:
1824
- id: requirements-txt-fixer
1925
- id: trailing-whitespace
2026

21-
- repo: https://github.com/asottile/pyupgrade
22-
rev: v2.10.0
23-
hooks:
24-
- id: pyupgrade
25-
# args: [--py36-plus]
26-
27-
2827
- repo: https://github.com/PyCQA/isort
2928
rev: 5.7.0
3029
hooks:
@@ -34,7 +33,6 @@ repos:
3433
rev: v1.16.0
3534
hooks:
3635
- id: setup-cfg-fmt
37-
args: [--min-py3-version, "3.5"]
3836

3937
- repo: https://github.com/mgedmin/check-manifest
4038
rev: "0.46"

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
Vector classes and utilities. See [CONTRIBUTING.md](./.github/CONTRIBUTING.md)
1616
for information on setting up a development environment.
1717

18-
Python 2 is partially supported; the simple, NumPy, and Awkward backends
19-
support Python 2. The Numba and AwkwardNumba (and TensorFlow, in the future)
20-
backends do not.
21-
2218

2319

2420
[gitter-badge]: https://badges.gitter.im/Scikit-HEP/vector.svg

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# Configuration file for the Sphinx documentation builder.
32
#
43
# This file only contains a selection of the most common options. For a full

setup.cfg

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ classifiers =
1919
License :: OSI Approved :: BSD License
2020
Operating System :: OS Independent
2121
Programming Language :: Python
22-
Programming Language :: Python :: 2
23-
Programming Language :: Python :: 2.7
2422
Programming Language :: Python :: 3
25-
Programming Language :: Python :: 3.5
23+
Programming Language :: Python :: 3 :: Only
2624
Programming Language :: Python :: 3.6
2725
Programming Language :: Python :: 3.7
2826
Programming Language :: Python :: 3.8
@@ -35,9 +33,8 @@ keywords =
3533
packages = find:
3634
install_requires =
3735
numpy>=1.13.3
38-
typing;python_version<"3.5"
3936
typing_extensions;python_version<"3.8"
40-
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
37+
python_requires = >=3.6
4138
package_dir =
4239
=src
4340

@@ -74,9 +71,6 @@ ignore_missing_imports = True
7471
[mypy-awkward]
7572
ignore_missing_imports = True
7673

77-
[bdist_wheel]
78-
universal = 1
79-
8074
[tool.check-manifest]
8175
ignore =
8276
.github

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
32
# Copyright (c) 2019-2020, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.
43
#
54
# Distributed under the 3-clause BSD license, see accompanying file LICENSE

src/vector/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# -*- coding: utf-8 -*-
21
# Copyright (c) 2019-2020, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.
32
#
43
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
54
# or https://github.com/scikit-hep/vector for details.
65

7-
from __future__ import absolute_import, division, print_function
86

97
# Convenient access to the version number
108
from .version import version as __version__

src/vector/awkward/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# -*- coding: utf-8 -*-
21
# Copyright (c) 2019-2020, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.
32
#
43
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
54
# or https://github.com/scikit-hep/vector for details.
6-
7-
from __future__ import absolute_import, division, print_function
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# -*- coding: utf-8 -*-
21
# Copyright (c) 2019-2020, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.
32
#
43
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
54
# or https://github.com/scikit-hep/vector for details.
6-
7-
from __future__ import absolute_import, division, print_function

src/vector/awkward/lorentz/xyzt.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# -*- coding: utf-8 -*-
21
# Copyright (c) 2019-2020, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.
32
#
43
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
54
# or https://github.com/scikit-hep/vector for details.
65

7-
from __future__ import absolute_import, division, print_function
86

97
import numbers
108
from typing import Any, Dict
@@ -42,7 +40,7 @@ def _create_behavior_r(function):
4240

4341

4442
# Define some behaviors for Lorentz vectors.
45-
behavior = dict() # type: Dict[Any, Any]
43+
behavior: Dict[Any, Any] = dict()
4644

4745
# Any records with __record__ = "LorentzXYZT" will be mapped to LorentzXYZT instances.
4846
behavior["LorentzXYZT"] = LorentzXYZT

0 commit comments

Comments
 (0)