Skip to content

Commit

Permalink
chore: remove Python 3.7 support (#355)
Browse files Browse the repository at this point in the history
* chore: remove Python 3.7 support

numba 0.57 requires Python 3.8

* Update README

* style: pre-commit fixes

* fix imports

* Update README.md

* Bump ruff's target version

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Saransh-cpp and pre-commit-ci[bot] authored Jun 22, 2023
1 parent 3866809 commit 9070e13
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 36 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
Expand Down Expand Up @@ -64,7 +63,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
Expand Down Expand Up @@ -96,7 +94,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[![LICENSE][license-badge]][license-link]
[![Scikit-HEP][sk-badge]][sk-link]

Vector is a Python 3.7+ library for 2D, 3D, and [Lorentz vectors](https://en.wikipedia.org/wiki/Special_relativity#Physics_in_spacetime), especially _arrays of vectors_, to solve common physics problems in a NumPy-like way.
Vector is a Python 3.8+ library (Python 3.6 and 3.7 supported till `v0.9.0` and `v1.0.0`, respectively) for 2D, 3D, and [Lorentz vectors](https://en.wikipedia.org/wiki/Special_relativity#Physics_in_spacetime), especially _arrays of vectors_, to solve common physics problems in a NumPy-like way.

Main features of Vector:

Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@

#### Maintenance

- chore: remove Python `3.7` support [#355][]
- chore: use trusted publisher deployment [#354][]
- chore: replace custom definition of np.isclose with numba's np.isclose [#348][]

[#355]: https://github.com/scikit-hep/vector/pull/355
[#354]: https://github.com/scikit-hep/vector/pull/354
[#347]: https://github.com/scikit-hep/vector/pull/347
[#348]: https://github.com/scikit-hep/vector/pull/348

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Overview
--------

Vector is a Python 3.7+ library for 2D, 3D, and `Lorentz vectors <https://en.wikipedia.org/wiki/Special_relativity#Physics_in_spacetime>`_, especially *arrays of vectors*, to solve common physics problems in a NumPy-like way.
Vector is a Python 3.8+ library (Python 3.6 and 3.7 supported till ``v0.9.0`` and ``v1.0.0``, respectively) for 2D, 3D, and `Lorentz vectors <https://en.wikipedia.org/wiki/Special_relativity#Physics_in_spacetime>`_, especially *arrays of vectors*, to solve common physics problems in a NumPy-like way.

Main features of Vector:

Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import nox

ALL_PYTHONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
ALL_PYTHONS = ["3.8", "3.9", "3.10", "3.11"]

nox.options.sessions = ["lint", "tests", "doctests"]

Expand Down
11 changes: 4 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ keywords = [
license = "BSD-3-Clause"
maintainers = [ {name = "The Scikit-HEP admins", email = "scikit-hep-admins@googlegroups.com"} ]
authors = [ {name = "Jim Pivarski, Henry Schreiner, Eduardo Rodrigues", email = "eduardo.rodrigues@cern.ch"} ]
requires-python = ">=3.7"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -24,7 +24,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -39,18 +38,16 @@ dynamic = [
"version",
]
dependencies = [
'importlib-metadata>=0.22; python_version < "3.8"',
"numpy>=1.13.3",
"packaging>=19",
'typing-extensions; python_version < "3.8"',
]
[project.optional-dependencies]
awkward = [
"awkward>=1.2",
]
dev = [
"awkward>=1.2",
'numba>=0.57; python_version >= "3.8"',
"numba>=0.57",
"papermill>=2.4",
"pytest>=6",
"pytest-cov>=3",
Expand Down Expand Up @@ -110,7 +107,7 @@ extend-ignore = [
"PLR", # Design related pylint codes
"E501", # Line too long
]
target-version = "py37"
target-version = "py38"
typing-modules = ["vector._typeutils"]
src = ["src"]
unfixable = [
Expand Down Expand Up @@ -175,7 +172,7 @@ disallow_untyped_defs = false
disallow_untyped_calls = false

[tool.pylint]
master.py-version = "3.7"
master.py-version = "3.8"
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
master.jobs = "0"
Expand Down
13 changes: 4 additions & 9 deletions src/vector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from __future__ import annotations

import sys
import importlib.metadata
import typing

import packaging.version
Expand Down Expand Up @@ -57,14 +57,9 @@
)
from vector.version import version as __version__

if sys.version_info < (3, 8):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata


def _import_awkward() -> None:
awk_version = packaging.version.Version(importlib_metadata.version("awkward"))
awk_version = packaging.version.Version(importlib.metadata.version("awkward"))
if awk_version < packaging.version.Version("1.2.0rc5"):
# the only context users will see this message is if they're trying to use vector.awk
# VectorAwkward is still set to None
Expand All @@ -75,9 +70,9 @@ def _import_awkward() -> None:
_is_awkward_v2: bool | None
try:
_is_awkward_v2 = packaging.version.Version(
importlib_metadata.version("awkward")
importlib.metadata.version("awkward")
) >= packaging.version.Version("2.0.0rc1")
except importlib_metadata.PackageNotFoundError:
except importlib.metadata.PackageNotFoundError:
_is_awkward_v2 = None
try:
import awkward
Expand Down
8 changes: 1 addition & 7 deletions src/vector/_typeutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@

from __future__ import annotations

import sys
import typing

if sys.version_info < (3, 8):
from typing_extensions import Protocol, TypedDict
else:
from typing import Protocol, TypedDict

from typing import Protocol, TypedDict

__all__ = [
"Protocol",
Expand Down
9 changes: 2 additions & 7 deletions tests/backends/test_awkward.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,21 @@

from __future__ import annotations

import sys
import importlib.metadata

import packaging.version
import pytest

import vector

if sys.version_info < (3, 8):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata

ak = pytest.importorskip("awkward")

pytestmark = pytest.mark.awkward


# Record reducers were added before awkward==2.2.3, but had some bugs.
awkward_without_record_reducers = packaging.version.Version(
importlib_metadata.version("awkward")
importlib.metadata.version("awkward")
) < packaging.version.Version("2.2.3")


Expand Down

0 comments on commit 9070e13

Please sign in to comment.