Skip to content
Merged
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
12 changes: 10 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@

version: 2
updates:
- package-ecosystem: "pip"
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
groups:
minor-and-patch:
update-types:
- "patch"
- "minor"
major:
update-types:
- "major"
open-pull-requests-limit: 5
assignees:
- "zoola969"
reviewers:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: install build dependencies
run: pip install .[build]

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6

- name: build
run: hatch build
run: uv build

- name: Store package distributions
uses: actions/upload-artifact@v3
with:
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ jobs:

strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
- uses: actions/checkout@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
python-version: ${{ matrix.python-version }}

- name: "Install dependencies"
run: "pip install -U pip && pip install .[test]"
run: uv sync --locked --no-default-groups --no-install-project --group test

- name: "Run mypy"
run: mypy ttlru_map
run: uv run mypy ttlru_map

- name: "Run tests"
run: "coverage run -m pytest tests/"
run: uv run coverage run -m pytest tests/

- name: "Enforce coverage"
run: "coverage report --show-missing --skip-covered --fail-under=100"
run: uv run coverage report --show-missing --skip-covered --fail-under=100
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:
autofix_prs: false
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
default_language_version:
python: python3.9
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
Expand All @@ -20,20 +20,20 @@ repos:
- id: no-commit-to-branch
args: [ --branch, master ]
- repo: https://github.com/pycqa/isort
rev: 6.0.1
rev: 7.0.0
hooks:
- id: isort
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.2.0
rev: v4.0.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.13.1'
rev: 'v0.14.8'
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- repo: https://github.com/psf/black
rev: 25.9.0
rev: 25.12.0
hooks:
- id: black
- repo: https://github.com/pappasam/toml-sort
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.2
- Drop python 3.9 support

## 1.1

- Drop python 3.8 support
Expand Down
47 changes: 25 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling~=1.7"]
requires = ["hatchling", "uv-dynamic-versioning"]

[dependency-groups]
dev = [
"black~=25.1",
"pre-commit~=4.0",
]
docs = [
"sphinx>=7.2,<9.0",
]
test = [
"coverage~=7.3",
"mypy~=1.19",
"pytest~=9.0",
]

[project]
authors = [
Expand All @@ -16,7 +30,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
Expand All @@ -28,23 +42,7 @@ keywords = ["cache", "dict", "expire", "expired", "lru", "lru-cache", "mapping",
license = {file = "LICENSE"}
name = "ttlru-map"
readme = "README.md"
requires-python = ">=3.9"

[project.optional-dependencies]
benchmarks = [
"perfplot~=0.10",
]
build = [
"hatch~=1.7",
]
docs = [
"sphinx>=7.2,<9.0",
]
test = [
"coverage~=7.3",
"mypy~=1.17",
"pytest~=8.1",
]
requires-python = ">=3.10"

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

[tool.hatch.version]
path = "ttlru_map/__init__.py"
source = "uv-dynamic-versioning"

[tool.isort]
float_to_top = true
Expand All @@ -71,7 +68,7 @@ use_parentheses = true
[tool.mypy]
strict = true

[tool.pytest.ini_options]
[tool.pytest]
addopts = [
"--code-highlight=yes",
"--color=yes",
Expand Down Expand Up @@ -156,3 +153,9 @@ sort_table_keys = true
spaces_before_inline_comment = 2
spaces_indent_inline_array = 4
trailing_comma_inline_array = true

[tool.uv]
default-groups = ["dev", "docs", "test"]

[tool.uv-dynamic-versioning]
fallback-version = "0.0.0"
4 changes: 3 additions & 1 deletion ttlru_map/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from importlib.metadata import version

from ._exceptions import TTLMapError, TTLMapInvalidConfigError
from ._ttl_map import TTLMap

__version__ = "1.1.0"
__version__ = version("ttlru_map")

__all__ = [
"TTLMap",
Expand Down
Loading
Loading