Skip to content

Commit 9100aa1

Browse files
authored
Update project configuration for UV integration and Python version (#27)
1 parent 6d0bc0e commit 9100aa1

9 files changed

Lines changed: 1087 additions & 47 deletions

File tree

.github/dependabot.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "pip"
8+
- package-ecosystem: "uv"
99
directory: "/"
1010
schedule:
1111
interval: "weekly"
12-
open-pull-requests-limit: 10
12+
groups:
13+
minor-and-patch:
14+
update-types:
15+
- "patch"
16+
- "minor"
17+
major:
18+
update-types:
19+
- "major"
20+
open-pull-requests-limit: 5
1321
assignees:
1422
- "zoola969"
1523
reviewers:

.github/workflows/publish.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: 3.12
20-
- name: install build dependencies
21-
run: pip install .[build]
16+
17+
- name: Install uv and set the python version
18+
uses: astral-sh/setup-uv@v6
19+
2220
- name: build
23-
run: hatch build
21+
run: uv build
22+
2423
- name: Store package distributions
2524
uses: actions/upload-artifact@v3
2625
with:

.github/workflows/tests.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,23 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
17+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1818

1919
steps:
20-
- uses: "actions/checkout@v4"
21-
- uses: "actions/setup-python@v5"
20+
- uses: actions/checkout@v4
21+
- name: Install uv and set the python version
22+
uses: astral-sh/setup-uv@v6
2223
with:
23-
python-version: "${{ matrix.python-version }}"
24-
allow-prereleases: true
24+
python-version: ${{ matrix.python-version }}
25+
2526
- name: "Install dependencies"
26-
run: "pip install -U pip && pip install .[test]"
27+
run: uv sync --locked --no-default-groups --no-install-project --group test
28+
2729
- name: "Run mypy"
28-
run: mypy ttlru_map
30+
run: uv run mypy ttlru_map
31+
2932
- name: "Run tests"
30-
run: "coverage run -m pytest tests/"
33+
run: uv run coverage run -m pytest tests/
34+
3135
- name: "Enforce coverage"
32-
run: "coverage report --show-missing --skip-covered --fail-under=100"
36+
run: uv run coverage report --show-missing --skip-covered --fail-under=100

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ipython_config.py
8585
# pyenv
8686
# For a library or package, you might want to ignore these files since the code is
8787
# intended to run in multiple environments; otherwise, check them in:
88-
.python-version
88+
.python-version
8989

9090
# pipenv
9191
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ci:
33
autofix_prs: false
44
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
55
default_language_version:
6-
python: python3.9
6+
python: python3.10
77
repos:
88
- repo: https://github.com/pre-commit/pre-commit-hooks
99
rev: v6.0.0
@@ -20,20 +20,20 @@ repos:
2020
- id: no-commit-to-branch
2121
args: [ --branch, master ]
2222
- repo: https://github.com/pycqa/isort
23-
rev: 6.0.1
23+
rev: 7.0.0
2424
hooks:
2525
- id: isort
2626
- repo: https://github.com/asottile/add-trailing-comma
27-
rev: v3.2.0
27+
rev: v4.0.0
2828
hooks:
2929
- id: add-trailing-comma
3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: 'v0.13.1'
31+
rev: 'v0.14.8'
3232
hooks:
3333
- id: ruff
3434
args: [ --fix, --exit-non-zero-on-fix ]
3535
- repo: https://github.com/psf/black
36-
rev: 25.9.0
36+
rev: 25.12.0
3737
hooks:
3838
- id: black
3939
- repo: https://github.com/pappasam/toml-sort

CHANGELOG.md

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

3+
## 1.2
4+
- Drop python 3.9 support
5+
36
## 1.1
47

58
- Drop python 3.8 support

pyproject.toml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
[build-system]
22
build-backend = "hatchling.build"
3-
requires = ["hatchling~=1.7"]
3+
requires = ["hatchling", "uv-dynamic-versioning"]
4+
5+
[dependency-groups]
6+
dev = [
7+
"black~=25.1",
8+
"pre-commit~=4.0",
9+
]
10+
docs = [
11+
"sphinx>=7.2,<9.0",
12+
]
13+
test = [
14+
"coverage~=7.3",
15+
"mypy~=1.19",
16+
"pytest~=9.0",
17+
]
418

519
[project]
620
authors = [
@@ -16,7 +30,7 @@ classifiers = [
1630
"Programming Language :: Python :: 3.11",
1731
"Programming Language :: Python :: 3.12",
1832
"Programming Language :: Python :: 3.13",
19-
"Programming Language :: Python :: 3.9",
33+
"Programming Language :: Python :: 3.14",
2034
"Programming Language :: Python",
2135
"Topic :: Software Development :: Libraries",
2236
"Typing :: Typed",
@@ -28,23 +42,7 @@ keywords = ["cache", "dict", "expire", "expired", "lru", "lru-cache", "mapping",
2842
license = {file = "LICENSE"}
2943
name = "ttlru-map"
3044
readme = "README.md"
31-
requires-python = ">=3.9"
32-
33-
[project.optional-dependencies]
34-
benchmarks = [
35-
"perfplot~=0.10",
36-
]
37-
build = [
38-
"hatch~=1.7",
39-
]
40-
docs = [
41-
"sphinx>=7.2,<9.0",
42-
]
43-
test = [
44-
"coverage~=7.3",
45-
"mypy~=1.17",
46-
"pytest~=8.1",
47-
]
45+
requires-python = ">=3.10"
4846

4947
[project.urls]
5048
Changelog = "https://github.com/zoola969/python_ttlru_map/CHANGELOG.md"
@@ -56,10 +54,9 @@ Repository = "https://github.com/zoola969/python_ttlru_map.git"
5654
[tool.black]
5755
color = true
5856
line-length = 120
59-
target-version = ['py39']
6057

6158
[tool.hatch.version]
62-
path = "ttlru_map/__init__.py"
59+
source = "uv-dynamic-versioning"
6360

6461
[tool.isort]
6562
float_to_top = true
@@ -71,7 +68,7 @@ use_parentheses = true
7168
[tool.mypy]
7269
strict = true
7370

74-
[tool.pytest.ini_options]
71+
[tool.pytest]
7572
addopts = [
7673
"--code-highlight=yes",
7774
"--color=yes",
@@ -156,3 +153,9 @@ sort_table_keys = true
156153
spaces_before_inline_comment = 2
157154
spaces_indent_inline_array = 4
158155
trailing_comma_inline_array = true
156+
157+
[tool.uv]
158+
default-groups = ["dev", "docs", "test"]
159+
160+
[tool.uv-dynamic-versioning]
161+
fallback-version = "0.0.0"

ttlru_map/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
from importlib.metadata import version
2+
13
from ._exceptions import TTLMapError, TTLMapInvalidConfigError
24
from ._ttl_map import TTLMap
35

4-
__version__ = "1.1.0"
6+
__version__ = version("ttlru_map")
57

68
__all__ = [
79
"TTLMap",

0 commit comments

Comments
 (0)