Skip to content

Commit

Permalink
Add support for Python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasah committed Nov 1, 2024
1 parent a9e9f47 commit 49fe5fb
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout tag/branch"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "Setup Python"
uses: "actions/setup-python@v3"
uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ jobs:
coverage: true
- name: py312
python-version: "3.12"
- name: py313
python-version: "3.13"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -34,6 +36,6 @@ jobs:
run: hatch run +py=${{ matrix.python-version }} test:cov
- name: Upload coverage reports to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Labone Python API Changelog

## Version 3.1.1

* Add support for Python 3.13

## Version 3.1.0
* Expose timeout from underlying package when creating a new connection.
This allows specifying custom timeouts, e.g. when dealing with slow networks
Expand Down Expand Up @@ -57,4 +61,4 @@ defined in the capnp schema.
* set Values(s)
* list nodes
* subscribe
* Async node tree implementation.
* Async node tree implementation.
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
]
dependencies = [
Expand Down Expand Up @@ -51,7 +52,7 @@ exclude = ["/.github", "/docs"]
packages = ["src/labone"]

[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]

[tool.hatch.envs.test]
dependencies = ["coverage[toml]>=6.5", "hypothesis", "pytest", "pytest-asyncio"]
Expand All @@ -75,7 +76,7 @@ cov-report = [
cov = ["test-cov", "cov-report"]

[[tool.hatch.envs.lint.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]

[tool.hatch.envs.lint]
dependencies = [
Expand All @@ -93,11 +94,11 @@ fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"]
all = ["style", "typing"]

[tool.black]
target-version = ["py38"]
target-version = ["py39"]

[tool.ruff]
src = ["src", "tests"]
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
select = ["ALL"]
Expand Down
4 changes: 2 additions & 2 deletions src/labone/core/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def fork(
Returns:
A new data queue to the same underlying subscription.
"""
return DataQueue.fork(
return DataQueue.fork( # type: ignore[return-value]
self,
queue_type=queue_type if queue_type is not None else CircularDataQueue,
)
Expand Down Expand Up @@ -371,7 +371,7 @@ def fork(
Returns:
A new data queue to the same underlying subscription.
"""
return DataQueue.fork(
return DataQueue.fork( # type: ignore[return-value]
self,
queue_type=(
queue_type if queue_type is not None else DistinctConsecutiveDataQueue
Expand Down
6 changes: 3 additions & 3 deletions src/labone/nodetree/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
T = t.TypeVar("T")


TreeProp = t.Dict[LabOneNodePath, T]
TreeProp = dict[LabOneNodePath, T]


class NestedDict(t.Protocol[T]): # type: ignore[misc]
Expand All @@ -46,9 +46,9 @@ def __iter__(self) -> t.Iterator[str]:
"""..."""


FlatPathDict: TypeAlias = t.Dict[
FlatPathDict: TypeAlias = dict[
NormalizedPathSegment,
t.List[t.List[NormalizedPathSegment]],
list[list[NormalizedPathSegment]],
]


Expand Down

0 comments on commit 49fe5fb

Please sign in to comment.