From cf35b88b79a0e76677ba56b77c7b546521fc9906 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 2 Apr 2024 07:35:43 -0400 Subject: [PATCH] chore: drop Python 3.7, add Python 3.12 (#428) * chore: drop Python 3.7, add Python 3.12 Signed-off-by: Henry Schreiner * Fix little typo --------- Signed-off-by: Henry Schreiner Co-authored-by: Eduardo Rodrigues --- .github/workflows/ci.yml | 9 ++++----- README.md | 6 +++--- pyproject.toml | 7 +++---- src/decaylanguage/_compat/typing.py | 7 +------ src/decaylanguage/decay/decay.py | 4 ++-- 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58f4eb80..294cb7a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,11 +36,11 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ['3.7', '3.8', '3.10', '3.11'] + python-version: ['3.8', '3.10', '3.12'] include: - {os: macos-latest, python-version: '3.9'} - - {os: windows-latest, python-version: '3.7'} - - {os: windows-latest, python-version: '3.9'} + - {os: windows-latest, python-version: '3.8'} + - {os: windows-latest, python-version: '3.11'} name: Check ${{ matrix.os }} Python ${{ matrix.python-version }} steps: @@ -62,11 +62,10 @@ jobs: run: python -m pytest ./tests --cov=src/decaylanguage --cov-report=xml - name: Test coverage with Codecov - if: "runner.os != 'Windows' && matrix.python-version != 3.7" uses: codecov/codecov-action@v4 - name: Test docstrings with doctest - if: "runner.os == 'Linux' && matrix.python-version == 3.11" + if: "runner.os == 'Linux' && matrix.python-version == 3.12" run: python -m pytest --doctest-modules src/decaylanguage notebooks: diff --git a/README.md b/README.md index e49523fa..8c87fe01 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ pip install decaylanguage You can use a virtual environment through pipenv or with `--user` if you know what those are. [Python -3.7+](http://docs.python-guide.org/en/latest/starting/installation) supported -(see version 0.12 for Python 2 & 3.5 support, 0.14 for Python 3.6 support). +3.8+](http://docs.python-guide.org/en/latest/starting/installation) supported +(see version 0.12 for Python 2 & 3.5 support, 0.14 for Python 3.6 support, 0.18 for Python 3.7 support).
Dependencies: (click to expand)

@@ -54,7 +54,7 @@ Required and compatibility dependencies will be automatically installed by pip. descriptions and visualizations of decay chains. ### Python compatibility: -- [importlib_resources](http://importlib-resources.readthedocs.io/en/latest/) backport if using Python /< 3.7 +- [importlib_resources](http://importlib-resources.readthedocs.io/en/latest/) backport if using Python /< 3.9

diff --git a/pyproject.toml b/pyproject.toml index ae6c62ee..43e2fe84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "hatchling.build" name = "decaylanguage" description = "A language to describe, manipulate and convert particle decays" readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "Eduardo Rodrigues", email = "eduardo.rodrigues@cern.ch" }, { name = "Henry Schreiner", email = "henryfs@princeton.edu" }, @@ -33,11 +33,11 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "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", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering", ] dependencies = [ @@ -49,7 +49,6 @@ dependencies = [ "pandas>=0.22", "particle>=0.22.0", "plumbum>=1.7.0", - "typing-extensions;python_version<\"3.8\"", ] dynamic = ["version"] @@ -113,7 +112,7 @@ xfail_strict = true [tool.pylint] -master.py-version = "3.7" +master.py-version = "3.8" reports.output-format = "colorized" similarities.ignore-imports = "yes" master.jobs = "0" diff --git a/src/decaylanguage/_compat/typing.py b/src/decaylanguage/_compat/typing.py index c99b7471..6d1946dd 100644 --- a/src/decaylanguage/_compat/typing.py +++ b/src/decaylanguage/_compat/typing.py @@ -3,11 +3,6 @@ import sys import typing -if sys.version_info < (3, 8): - from typing_extensions import TypedDict -else: - from typing import TypedDict - if sys.version_info < (3, 11): if typing.TYPE_CHECKING: from typing_extensions import Self @@ -17,4 +12,4 @@ from typing import Self -__all__ = ["TypedDict", "Self"] +__all__ = ["Self"] diff --git a/src/decaylanguage/decay/decay.py b/src/decaylanguage/decay/decay.py index 20c88550..5b0d434f 100644 --- a/src/decaylanguage/decay/decay.py +++ b/src/decaylanguage/decay/decay.py @@ -10,13 +10,13 @@ from collections.abc import Sequence from copy import deepcopy from itertools import product -from typing import TYPE_CHECKING, Any, Dict, Iterable, Iterator, List +from typing import TYPE_CHECKING, Any, Dict, Iterable, Iterator, List, TypedDict from particle import PDGID, ParticleNotFound from particle.converters import EvtGenName2PDGIDBiMap from particle.exceptions import MatchingIDNotFound -from .._compat.typing import Self, TypedDict +from .._compat.typing import Self from ..utils import DescriptorFormat, charge_conjugate_name if TYPE_CHECKING: