Skip to content

Commit

Permalink
chore: drop Python 3.7, add Python 3.12 (#428)
Browse files Browse the repository at this point in the history
* chore: drop Python 3.7, add Python 3.12

Signed-off-by: Henry Schreiner <[email protected]>

* Fix little typo

---------

Signed-off-by: Henry Schreiner <[email protected]>
Co-authored-by: Eduardo Rodrigues <[email protected]>
  • Loading branch information
henryiii and eduardo-rodrigues authored Apr 2, 2024
1 parent a4e8047 commit cf35b88
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<details><summary>Dependencies: (click to expand)</summary><p>

Expand All @@ -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
</p></details>


Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" },
{ name = "Henry Schreiner", email = "[email protected]" },
Expand All @@ -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 = [
Expand All @@ -49,7 +49,6 @@ dependencies = [
"pandas>=0.22",
"particle>=0.22.0",
"plumbum>=1.7.0",
"typing-extensions;python_version<\"3.8\"",
]
dynamic = ["version"]

Expand Down Expand Up @@ -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"
Expand Down
7 changes: 1 addition & 6 deletions src/decaylanguage/_compat/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,4 +12,4 @@
from typing import Self


__all__ = ["TypedDict", "Self"]
__all__ = ["Self"]
4 changes: 2 additions & 2 deletions src/decaylanguage/decay/decay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cf35b88

Please sign in to comment.