Skip to content

Commit

Permalink
MAINT: update lock files (#445)
Browse files Browse the repository at this point in the history
* DX: remove `files.watcherExclude`
* MAINT: address PYI066
  https://docs.astral.sh/ruff/rules/bad-version-info-order/
* MAINT: implement updates from `check-dev-files`
* MAINT: remove `enable-cache` argument (defaults to true)
* MAINT: update to `astral-sh/setup-uv@v5`
* MAINT: implement updates from pre-commit hooks
* MAINT: update to QRules with `Fraction`s syntax
  • Loading branch information
Zeyna777 authored Dec 20, 2024
1 parent 23cef79 commit 2bbf608
Show file tree
Hide file tree
Showing 17 changed files with 1,042 additions and 656 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
"yticks"
],
"language": "en-US",
"useGitignore": true,
"version": "0.2",
"words": [
"ampform",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- uses: astral-sh/setup-uv@v5
- id: with
if: inputs.specific-pip-packages
name: Determine additional packages to install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-qrules-v0.9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- uses: astral-sh/setup-uv@v5
- name: Run pytest with QRules v0.9
run: |
uv run \
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.5.6
rev: 0.5.8
hooks:
- id: check-dev-files
args:
Expand All @@ -33,7 +33,7 @@ repos:
- --extras-require=doc,viz

- repo: https://github.com/kynan/nbstripout
rev: 0.8.0
rev: 0.8.1
hooks:
- id: nbstripout
args:
Expand Down Expand Up @@ -61,7 +61,7 @@ repos:
metadata.vscode
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.8.4
hooks:
- id: ruff
args: [--fix]
Expand Down Expand Up @@ -98,7 +98,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/ComPWA/prettier-pre-commit
rev: v3.3.3
rev: v3.4.2
hooks:
- id: prettier

Expand All @@ -108,14 +108,14 @@ repos:
- id: taplo-format

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
rev: v0.24.2
hooks:
- id: toml-sort
args:
- --in-place

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.30.0
hooks:
- id: check-jsonschema
name: Check CITATION.cff
Expand All @@ -128,7 +128,7 @@ repos:
pass_filenames: false

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.15.3
rev: v8.17.0
hooks:
- id: cspell

Expand All @@ -154,11 +154,11 @@ repos:
- python

- repo: https://github.com/ComPWA/pyright-pre-commit
rev: v1.1.388
rev: v1.1.391
hooks:
- id: pyright

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.30
rev: 0.5.11
hooks:
- id: uv-lock
2 changes: 2 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ms-python.mypy-type-checker",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-vscode.live-server",
"ms-vsliveshare.vsliveshare",
Expand All @@ -31,6 +32,7 @@
"ms-python.flake8",
"ms-python.isort",
"ms-python.pylint",
"ms-toolsai.vscode-jupyter-slideshow",
"travisillig.vscode-json-stable-stringify",
"tyriar.sort-lines"
]
Expand Down
6 changes: 0 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
"coverage-gutters.showLineCoverage": true,
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
"files.watcherExclude": {
"**/*_cache/**": true,
"**/.eggs/**": true,
"**/.git/**": true,
"**/.tox/**": true
},
"git.rebaseWhenSync": true,
"github-actions.workflows.pinned.refresh.enabled": true,
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ split-on-trailing-comma = false
"S403",
"SLF001",
"T20",
"TCH00",
"TC00",
]
"**/docs/usage/dynamics.ipynb" = ["FURB118", "RUF027"]
"**/docs/usage/symplot.ipynb" = ["RUF027"]
Expand Down
6 changes: 3 additions & 3 deletions src/ampform/helicity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
from ampform.sympy import PoolSum, determine_indices
from ampform.sympy._array_expressions import ArraySum

if sys.version_info < (3, 12):
from typing_extensions import override
else:
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from collections.abc import (
ItemsView,
Expand Down
6 changes: 3 additions & 3 deletions src/ampform/helicity/decay.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

from typing import Literal

if sys.version_info < (3, 10):
from typing_extensions import TypeGuard
else:
if sys.version_info >= (3, 10):
from typing import TypeGuard
else:
from typing_extensions import TypeGuard


@frozen
Expand Down
9 changes: 5 additions & 4 deletions src/ampform/helicity/naming.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
group_by_spin_projection,
)

if sys.version_info < (3, 12):
from typing_extensions import override
else:
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from collections.abc import Iterable
from fractions import Fraction

from qrules.topology import Topology

Expand Down Expand Up @@ -503,7 +504,7 @@ def _state_to_str(
return output_string


def _render_float(value: float) -> str:
def _render_float(value: float | Fraction) -> str:
"""Render a `float` nicely as a string.
>>> _render_float(-0.5)
Expand Down
6 changes: 3 additions & 3 deletions src/ampform/kinematics/lorentz.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
)
from ampform.sympy.math import ComplexSqrt

if sys.version_info < (3, 10):
from typing_extensions import TypeAlias
else:
if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias
if TYPE_CHECKING:
from qrules.topology import Topology
from sympy.printing.latex import LatexPrinter
Expand Down
10 changes: 5 additions & 5 deletions src/ampform/sympy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
make_commutative, # pyright: ignore[reportUnusedImport] # noqa: F401
)

if sys.version_info < (3, 11):
from typing_extensions import Self
else:
if sys.version_info >= (3, 11):
from typing import Self
if sys.version_info < (3, 12):
from typing_extensions import override
else:
from typing_extensions import Self
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from collections.abc import Iterable, Sequence

Expand Down
10 changes: 5 additions & 5 deletions src/ampform/sympy/_array_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
get_shape,
)

if sys.version_info < (3, 11):
from typing_extensions import Self
else:
if sys.version_info >= (3, 11):
from typing import Self
if sys.version_info < (3, 12):
from typing_extensions import override
else:
from typing_extensions import Self
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from collections.abc import Iterable

Expand Down
12 changes: 6 additions & 6 deletions src/ampform/sympy/_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
from sympy.core.basic import _aresame # noqa: PLC2701
from sympy.utilities.exceptions import SymPyDeprecationWarning

if sys.version_info < (3, 11):
from typing_extensions import dataclass_transform
else:
if sys.version_info >= (3, 11):
from typing import dataclass_transform
else:
from typing_extensions import dataclass_transform

if TYPE_CHECKING:
from collections.abc import Hashable, Iterable

from sympy.printing.latex import LatexPrinter

if sys.version_info < (3, 11):
from typing_extensions import ParamSpec, Unpack
else:
if sys.version_info >= (3, 11):
from typing import ParamSpec, Unpack
else:
from typing_extensions import ParamSpec, Unpack

H = TypeVar("H", bound=Hashable)
P = ParamSpec("P")
Expand Down
6 changes: 3 additions & 3 deletions src/ampform/sympy/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

import sympy as sp

if sys.version_info < (3, 12):
from typing_extensions import override
else:
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from sympy.printing.latex import LatexPrinter

Expand Down
6 changes: 3 additions & 3 deletions src/ampform/sympy/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

from ampform.sympy import NumPyPrintable

if sys.version_info < (3, 12):
from typing_extensions import override
else:
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from sympy.printing.numpy import NumPyPrinter
from sympy.printing.printer import Printer
Expand Down
Loading

0 comments on commit 2bbf608

Please sign in to comment.