Skip to content

Commit 3581a8c

Browse files
Update dependencies and require Python 3.9+, prepare release 0.19.0 (#505)
* Update dependencies and require Python 3.9+, prepare release 0.19.0 * Update CHANGELOG * style: pre-commit fixes * Good catch from ruff on unnecessary 'if sys.version_info < (3, 9)' at this point * style: pre-commit fixes * Simplify typing given that we now require Python >= 3.9 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2cf7322 commit 3581a8c

File tree

8 files changed

+26
-22
lines changed

8 files changed

+26
-22
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
os: [ubuntu-latest]
38-
python-version: ['3.8', '3.10', '3.13']
38+
python-version: ['3.9', '3.10', '3.13']
3939
include:
4040
- {os: macos-13, python-version: '3.9'}
4141
- {os: macos-latest, python-version: '3.13'}
42-
- {os: windows-latest, python-version: '3.8'}
42+
- {os: windows-latest, python-version: '3.9'}
4343
- {os: windows-latest, python-version: '3.13'}
4444

4545
steps:

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## Version 0.19.0 (2025-07-04)
4+
5+
* Dependencies:
6+
- Package dependent on ``Particle`` >= 0.25.4 and `hepunits` >= 2.3.5 to adapt to change in `Particle`.
7+
- Removed support for Python 3.8.
8+
* CI and tests:
9+
- Updates to pre-commit hooks and CI YAML files.
10+
311
## Version 0.18.6 (2025-01-17)
412

513
* CI and tests:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ pip install decaylanguage
3434

3535
You can use a virtual environment through pipenv or with `--user` if you know
3636
what those are. [Python
37-
3.8+](http://docs.python-guide.org/en/latest/starting/installation) supported
38-
(see version 0.12 for Python 2 & 3.5 support, 0.14 for Python 3.6 support, 0.18 for Python 3.7 support).
37+
3.9+](http://docs.python-guide.org/en/latest/starting/installation) supported
38+
(see version 0.14 for Python 3.6 support, 0.18 for Python 3.7 and 3.8 support).
3939

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

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "hatchling.build"
99
name = "decaylanguage"
1010
description = "A language to describe, manipulate and convert particle decays"
1111
readme = "README.md"
12-
requires-python = ">=3.8"
12+
requires-python = ">=3.9"
1313
authors = [
1414
{ name = "Eduardo Rodrigues", email = "eduardo.rodrigues@cern.ch" },
1515
{ name = "Henry Schreiner", email = "henryfs@princeton.edu" },
@@ -33,7 +33,6 @@ classifiers = [
3333
"Programming Language :: Python",
3434
"Programming Language :: Python :: 3",
3535
"Programming Language :: Python :: 3 :: Only",
36-
"Programming Language :: Python :: 3.8",
3736
"Programming Language :: Python :: 3.9",
3837
"Programming Language :: Python :: 3.10",
3938
"Programming Language :: Python :: 3.11",
@@ -48,8 +47,8 @@ dependencies = [
4847
"lark>=1.0.0",
4948
"numpy>=1.12",
5049
"pandas>=0.22",
51-
"particle>=0.22.0",
52-
"hepunits>=2.0.0",
50+
"particle>=0.25.4",
51+
"hepunits>=2.3.5",
5352
"plumbum>=1.7.0",
5453
]
5554
dynamic = ["version"]

src/decaylanguage/data/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
from __future__ import annotations
22

3-
import sys
4-
5-
if sys.version_info < (3, 9):
6-
import importlib_resources as resources
7-
else:
8-
from importlib import resources
9-
3+
from importlib import resources
104

115
__all__ = ["basepath"]
126

src/decaylanguage/dec/dec.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@
4242
import os
4343
import re
4444
import warnings
45+
from collections.abc import Iterable
4546
from io import StringIO
4647
from itertools import chain, zip_longest
4748
from pathlib import Path
48-
from typing import Any, Callable, Iterable
49+
from typing import Any, Callable
4950

5051
from hepunits import GeV
5152
from lark import Lark, Token, Transformer, Tree, Visitor

src/decaylanguage/decay/decay.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
import typing
1010
from collections import Counter
11-
from collections.abc import Collection, Sequence
11+
from collections.abc import Collection, Iterable, Iterator, Sequence
1212
from copy import deepcopy
1313
from itertools import product
14-
from typing import TYPE_CHECKING, Any, Dict, Iterable, Iterator, List, TypedDict
14+
from typing import TYPE_CHECKING, Any, TypedDict
1515

1616
from particle import PDGID, ParticleNotFound
1717
from particle.converters import EvtGenName2PDGIDBiMap
@@ -33,7 +33,7 @@ class DecayModeDict(TypedDict):
3333
model_params: str | Sequence[str | Any]
3434

3535

36-
DecayChainDict = Dict[str, List[DecayModeDict]]
36+
DecayChainDict = dict[str, list[DecayModeDict]]
3737

3838

3939
class DaughtersDict(CounterStr):
@@ -952,8 +952,8 @@ def to_dict(self) -> DecayChainDict:
952952
'model_params': ''}]}
953953
"""
954954

955-
# Ideally this would be a recursive type, DecayDict = Dict[str, list[str | DecayDict]]
956-
DecayDict = Dict[str, List[Any]]
955+
# Ideally this would be a recursive type, DecayDict = dict[str, list[str | DecayDict]]
956+
DecayDict = dict[str, list[Any]]
957957

958958
def recursively_replace(mother: str) -> DecayDict:
959959
dm = self.decays[mother].to_dict()

src/decaylanguage/utils/utilities.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
from __future__ import annotations
77

88
import string
9+
from collections.abc import Iterator
910
from copy import copy
10-
from typing import Any, ClassVar, Iterator, Pattern
11+
from re import Pattern
12+
from typing import Any, ClassVar
1113

1214

1315
def iter_flatten(iterable: list[str] | tuple[str, ...]) -> Iterator[str]:

0 commit comments

Comments
 (0)