Skip to content

Commit dc2b703

Browse files
authored
Merge pull request #466 from MC-kit/devel
switch to msgspec from PyPI: not it supports python 3.13
2 parents 5501ef3 + 10fd606 commit dc2b703

File tree

12 files changed

+2515
-1788
lines changed

12 files changed

+2515
-1788
lines changed

.github/constraints.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pip==24.1.2
2-
poetry==1.8.3
1+
pip==24.3.1
2+
poetry==1.8.4
33

.github/workflows/tests.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,6 @@ jobs:
236236
nox --force-color --session=coverage -- xml
237237
238238
- name: Upload coverage report
239-
uses: codecov/codecov-action@v4
239+
uses: codecov/codecov-action@v5
240+
with:
241+
token: ${{ secrets.CODECOV_TOKEN }}

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ repos:
111111
# exclude: ^notebooks|^extern
112112

113113
- repo: https://github.com/astral-sh/ruff-pre-commit
114-
rev: v0.7.0
114+
rev: v0.8.4
115115
hooks:
116116
- id: ruff
117117
exclude: ^notebooks|^extern

docs/requirements.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
sphinx==5.1.1
2-
sphinx-autobuild==2021.3.14
3-
sphinx-autodoc-typehints==1.19.2
1+
sphinx==8.1.3
2+
sphinx-autobuild==2024.10.3
3+
sphinx-autodoc-typehints==2.5.0
44
sphinx-autorun==1.1.1
55
sphinx-click==4.3.0
6-
sphinx-rtd-theme==1.2.0
6+
sphinx-rtd-theme==3.0.2
77
sphinxcontrib-napoleon==0.7

noxfile.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def find_my_name() -> str:
4848
Raises:
4949
ValueError: if the pattern is not found.
5050
"""
51-
with Path("pyproject.toml").open() as fid:
51+
with Path("pyproject.toml").open(encoding="utf8") as fid:
5252
for line in fid:
5353
res = NAME_RGX.match(line)
5454
if res is not None:
@@ -67,7 +67,7 @@ def find_my_name() -> str:
6767
def _update_hook(hook: Path, virtualenv: str, s: Session) -> None:
6868
text = hook.read_text()
6969
bin_dir = repr(s.bin)[1:-1] # strip quotes
70-
if Path("A") == Path("a") and bin_dir.lower() in text.lower() or bin_dir in text:
70+
if (Path("A") == Path("a") and bin_dir.lower() in text.lower()) or bin_dir in text:
7171
lines = text.splitlines()
7272
if lines[0].startswith("#!") and "python" in lines[0].lower():
7373
header = dedent(

poetry.lock

+2,473-1,760
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+22-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "xpypact"
3-
version = "0.12.3"
3+
version = "0.12.4"
44
description = "\"Python workflow framework for FISPACT.\""
55
authors = ["dvp <[email protected]>"]
66
license = "MIT"
@@ -26,9 +26,7 @@ classifiers = [
2626
"Intended Audience :: Developers",
2727
"Intended Audience :: Science/Research",
2828
"Operating System :: OS Independent",
29-
"Programming Language :: Python",
3029
"Programming Language :: Python :: 3",
31-
"Programming Language :: Python :: 3 :: Only",
3230
"Programming Language :: Python :: 3.10",
3331
"Programming Language :: Python :: 3.11",
3432
"Programming Language :: Python :: 3.12",
@@ -54,10 +52,11 @@ duckdb = ">=1.0.0"
5452
mckit-nuclides = ">=0.3.2"
5553
multipledispatch = ">=0.6.0"
5654
numpy = ">=2.0"
57-
polars = {version = ">=1.12.0", extras = ["all"]}
55+
polars = { version = ">=1.12.0", extras = ["all"] }
5856
pyarrow = ">=18.0.0"
5957
rich = ">=13.7.0"
60-
msgspec = {git = "https://github.com/jcrist/msgspec.git", rev = "main"} # TODO: switch back to PyPI on update to Python 3.13
58+
msgspec = ">=0.19.0"
59+
poetry = "^1.8.5"
6160

6261
[tool.poetry.group.dev.dependencies]
6362
Pygments = ">=2.10.0"
@@ -152,7 +151,7 @@ addopts = '''
152151
--failed-first
153152
--xdoctest
154153
'''
155-
doctest_optionflags = "ELLIPSIS NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ALLOW_UNICODE ALLOW_BYTES"
154+
doctest_optionflags = "ELLIPSIS NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ALLOW_UNICODE ALLOW_BYTES NUMBER"
156155
testpaths = ["tests", "src"]
157156
markers = [
158157
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
@@ -304,11 +303,23 @@ src = ["src", "tests"]
304303

305304
exclude = [
306305
"*.egg-info",
306+
".direnv",
307307
".cache",
308+
".eggs",
309+
".git",
310+
".git-rewrite",
311+
".mypy_cache",
312+
".nox",
313+
".ruff_cache",
314+
".venv",
308315
"__pycache__",
316+
"_build",
309317
"adhoc",
318+
"build",
319+
"dist",
310320
"docs/source/conf.py",
311321
"notebooks",
322+
"venv",
312323
"wrk",
313324
]
314325

@@ -317,24 +328,27 @@ exclude = [
317328
#or run 'ruff linter' to see a brief list
318329
select = [
319330
"A", # flake8-builtins
320-
"ANN", # flake8-annotations
321331
"AIR", # Airflow https://airflow.apache.org/docs/apache-airflow/stable/index.html
332+
"ANN", # flake8-annotations
322333
"ARG", # flake8-unused-arguments
323334
"ASYNC", # flake8-async
324335
"B", # flake8-bugbear
325336
"BLE", # flake8-blind-except
326337
"C4", # flake8-comprehensions
327338
"C90", # mccabe
328339
"COM", # flake8-commas
340+
# "CPY", # flake8-copyright
329341
"D", # pydocstyle
330342
"DJ", # flake8-django
343+
"DOC", # pydoclint
331344
"DTZ", # flake8-datetimez
332345
"E", # pycodestyle
333346
"EM", # flake8-errmsg
334347
"ERA", # eradicate
335348
"EXE", # flake8-executable
336349
"F", # Pyflakes
337350
"FA", # flake8-future-annotations
351+
# "FAST", # FastAPI
338352
"FBT", # flake8-boolean-trap https://adamj.eu/tech/2021/07/10/python-type-hints-how-to-avoid-the-boolean-trap
339353
"FIX", # flake8-fixme
340354
"FLY", # flynt
@@ -381,8 +395,6 @@ select = [
381395
ignore = [
382396
"ANN001", # ANN001 Missing type annotation for function argument: doesn't allow to use functools dispatching
383397
# "ANN002", # ANN002 Missing type annotation for *drop_items: ... as above
384-
"ANN101", # ANN101 Missing type annotation for self in method
385-
"ANN102", # ANN102 Missing type annotation for cls in classmethod
386398
# "ANN201", # Missing return type annotation for public function `mesh2com`
387399
"ANN202", # ANN202 Missing return type annotation for protected function: ... dispatching
388400
# "ANN204", # ANN204 Missing return type annotation for special method
@@ -483,7 +495,7 @@ ignore = [
483495

484496

485497
[tool.ruff.lint.per-file-ignores]
486-
"__init__.py" = ["E402"]
498+
"**/__init__.py" = ["E402"]
487499
"src/xpypact/fluxes.py" = ["F811"]
488500
"benchmarks/*" = ["S101"]
489501
"noxfile.py" = ["ANN"]

src/xpypact/inventory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import numpy as np
1414

1515
# noinspection PyUnresolvedReferences
16-
from xpypact.time_step import TimeStep # noqa: TCH001 - required for Struct field
16+
from xpypact.time_step import TimeStep # noqa: TC001 - required for Struct field
1717

1818
if TYPE_CHECKING:
1919
from collections.abc import Iterable, Iterator

src/xpypact/nuclide.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class Nuclide(ms.Struct): # pylint: disable=too-many-instance-attributes
6161

6262
def __post_init__(self) -> None:
6363
"""Make the values consistent in data from old FISPACT."""
64-
if (
65-
self.zai == 0 or self.atoms == FLOAT_ZERO and self.grams > FLOAT_ZERO
64+
if self.zai == 0 or (
65+
self.atoms == FLOAT_ZERO and self.grams > FLOAT_ZERO
6666
): # pragma: no cover
6767
_z = z(self.element)
6868
if self.zai == 0:
@@ -91,4 +91,4 @@ def info(self) -> NuclideInfo:
9191
return NuclideInfo(self.zai, self.element, self.a, self.state, self.half_life)
9292

9393

94-
__all__ = ["Avogadro", "Nuclide", "NuclideInfo", "FLOAT_ZERO", "eV", "MeV"]
94+
__all__ = ["FLOAT_ZERO", "Avogadro", "MeV", "Nuclide", "NuclideInfo", "eV"]

src/xpypact/time_step.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import msgspec as ms
66

7-
from xpypact.nuclide import Nuclide # noqa: TCH001 - need for Struct field
7+
from xpypact.nuclide import Nuclide # noqa: TC001 - need for Struct field
88

99
FLOAT_ZERO = 0.0
1010

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def data() -> Path:
3131

3232

3333
@pytest.fixture
34-
def cd_tmpdir(tmpdir): # noqa: PT004
34+
def cd_tmpdir(tmpdir):
3535
"""Temporarily switch to temp directory.
3636
3737
Args:

tools/reset-pyenv

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ reset() {
1818
local env="${1:-}"
1919
read -r -a pkgs <<< "$(ls -1 src)"
2020
local pkg=${pkgs[0]}
21-
local last_python="3.13.0"
21+
local last_python="3.13.1"
2222
[[ -z "$env" ]] && env="${pkg//_/-}"
2323
echo "Installing package $pkg to environment $env with python $last_python."
2424
eval "$(pyenv init -)"
@@ -34,7 +34,7 @@ reset() {
3434
poetry lock --no-update
3535
poetry install
3636
pyenv deactivate
37-
pyenv local "$env" "3.12.7" "3.11.10" "3.10.15" "3.9.20"
37+
pyenv local "$env" "3.12.8" "3.11.11" "3.10.16"
3838
pyenv rehash
3939
pyenv activate "$env"
4040
python -c "import ${pkg}; print(${pkg}.__version__)" && success "Environment $env is reset"

0 commit comments

Comments
 (0)