8000 Add support for Python 3.13, drop support for 3.8 by Viicos · Pull Request #35 · Viicos/jsonlogic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for Python 3.13, drop support for 3.8 #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: '3.13'
- name: Install dependencies
run: |
pip install uv
Expand All @@ -24,10 +24,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: '3.13'
- name: Install dependencies
run: |
pip install uv
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Install dependencies
run: |
pip install uv
Expand All @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand All @@ -45,10 +45,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Install dependencies
run: |
pip install uv
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
sys.path.insert(0, str(Path(__file__).parents[2] / "src"))

project = "python-jsonlogic"
copyright = "2024, Victorien"
copyright = "2024-%Y, Victorien"
author = "Victorien"
release = "0.1.0"

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"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",
"Programming Language :: Python :: 3.13",
"Typing :: Typed",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
Expand All @@ -43,7 +43,7 @@ where = ["src"]
[tool.ruff]
line-length = 120
src = ["src"]
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
typing-modules = ["jsonlogic._compat"]
Expand Down
18 changes: 9 additions & 9 deletions requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements/requirements-dev.in
#
nodeenv==1.9.0
# This file was autogenerated by uv via the following command:
# uv pip compile requirements/requirements-dev.in -o requirements/requirements-dev.txt
nodeenv==1.9.1
# via pyright
pyright==1.1.365
pyright==1.1.392.post0
# via -r requirements/requirements-dev.in
ruff==0.6.8
ruff==0.9.3
# via -r requirements/requirements-dev.in
typing-extensions==4.12.2
# via
# -c requirements/requirements.txt
# pyright
32 changes: 14 additions & 18 deletions requirements/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements/requirements-docs.in
#
alabaster==0.7.16
# This file was autogenerated by uv via the following command:
# uv pip compile requirements/requirements-docs.in -o requirements/requirements-docs.txt
alabaster==1.0.0
# via sphinx
babel==2.15.0
babel==2.16.0
# via sphinx
beautifulsoup4==4.12.3
# via furo
certifi==2024.6.2
certifi==2024.12.14
# via requests
charset-normalizer==3.3.2
charset-normalizer==3.4.1
# via requests
docutils==0.21.2
# via
Expand All @@ -24,27 +20,27 @@ idna==3.10
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.4
jinja2==3.1.5
# via sphinx
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
packaging==24.1
packaging==24.2
# via sphinx
polib==1.2.0
# via sphinx-lint
pygments==2.18.0
pygments==2.19.1
# via
# furo
# sphinx
regex==2024.5.15
regex==2024.11.6
# via sphinx-lint
requests==2.32.3
# via sphinx
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.5
soupsieve==2.6
# via beautifulsoup4
sphinx==8.0.2
sphinx==8.1.3
# via
# -r requirements/requirements-docs.in
# furo
Expand All @@ -68,5 +64,5 @@ sphinxcontrib-qthelp==2.0.0
# via sphinx
sphinxcontrib-serializinghtml==2.0.0
# via sphinx
urllib3==2.2.3
urllib3==2.3.0
# via requests
34 changes: 17 additions & 17 deletions requirements/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements/requirements-test.in
#
cachetools==5.5.0
# This file was autogenerated by uv via the following command:
# uv pip compile requirements/requirements-test.in -o requirements/requirements-test.txt
cachetools==5.5.1
# via tox
chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
distlib==0.3.8
distlib==0.3.9
# via virtualenv
filelock==3.16.1
filelock==3.17.0
# via
# tox
# virtualenv
iniconfig==2.0.0
# via pytest
nodeenv==1.9.0
nodeenv==1.9.1
# via pyright
packaging==24.1
packaging==24.2
# via
# pyproject-api
# pytest
Expand All @@ -33,19 +29,23 @@ pluggy==1.5.0
# via
# pytest
# tox
pyproject-api==1.8.0
pyproject-api==1.9.0
# via tox
pyright==1.1.365
pyright==1.1.392.post0
# via -r requirements/requirements-test.in
pytest==8.3.3
pytest==8.3.4
# via -r requirements/requirements-test.in
tomli==2.0.1
tomli==2.2.1
# via -r requirements/requirements-test.in
tox==4.21.0
tox==4.24.1
# via
# -r requirements/requirements-test.in
# tox-gh-actions
tox-gh-actions==3.2.0
# via -r requirements/requirements-test.in
virtualenv==20.26.6
typing-extensions==4.12.2
# via
# -c requirements/requirements.txt
# pyright
virtualenv==20.29.1
# via tox
8 changes: 2 additions & 6 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements/requirements.in
#
# This file was autogenerated by uv via the following command:
# uv pip compile requirements/requirements.in -o requirements/requirements.txt
typing-extensions==4.12.2
# via -r requirements/requirements.in
7 changes: 4 additions & 3 deletions src/jsonlogic/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from __future__ import annotations

from typing import Callable, Type, TypeVar, overload
from collections.abc import Callable
from typing import TypeVar, overload

from ._compat import Self, TypeAlias
from .core import Operator
Expand All @@ -22,9 +23,9 @@ def __init__(self, operator_id: str, /) -> None:
self.operator_id = operator_id


OperatorType: TypeAlias = Type[Operator]
OperatorType: TypeAlias = type[Operator]

OperatorTypeT = TypeVar("OperatorTypeT", bound=Type[Operator])
OperatorTypeT = TypeVar("OperatorTypeT", bound=type[Operator])


class OperatorRegistry:
Expand Down
7 changes: 4 additions & 3 deletions src/jsonlogic/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import annotations

import enum
from collections.abc import Generator
from contextlib import contextmanager
from typing import Generic, Iterator, Literal, TypeVar
from typing import Generic, Literal, TypeVar

from ._compat import TypeAlias

Expand All @@ -17,7 +18,7 @@ def __repr__(self) -> str:
UNSET = _UnsetTypeEnum.UNSET
"""A sentinel value representing an unset (or not provided) value."""

UnsetType: TypeAlias = Literal[UNSET]
UnsetType: TypeAlias = Literal[_UnsetTypeEnum.UNSET]
"""The type of the :data:`UNSET` sentinel value."""


Expand All @@ -38,7 +39,7 @@ def get(self, index: int, /) -> DataT:
return self._stack[-index - 1]

@contextmanager
def push(self, data: DataT) -> Iterator[None]:
def push(self, data: DataT) -> Generator[None]:
self._stack.append(data)

try:
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[tox]
requires =
tox>4
envlist = py3{8,9,10,11,12}
envlist = py3{9,10,11,12,13}

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313

[testenv]
deps =
Expand Down
Loading
0