Skip to content

Commit b44e3ee

Browse files
committed
update to uv
1 parent 01dbb3f commit b44e3ee

10 files changed

+74
-50
lines changed

.github/workflows/test-lint.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
- '3.10'
2222
- '3.11'
2323
- '3.12'
24+
- '3.13'
2425

2526
steps:
2627
- name: Checkout code
@@ -31,16 +32,16 @@ jobs:
3132
with:
3233
python-version: ${{ matrix.python-version }}
3334

34-
- name: Install Poetry
35+
- name: Install UV
3536
run: |
36-
curl -sSL https://install.python-poetry.org | python3 -
37+
curl -LsSf https://astral.sh/uv/install.sh | sh
3738
3839
- name: Install dependencies
39-
run: poetry install
40+
run: uv sync
4041

4142
- name: Run pytest
42-
run: poetry run pytest
43+
run: uv run pytest
4344

4445
- name: Run ruff
45-
run: poetry run ruff check --output-format=github
46+
run: uv run ruff check --output-format=github
4647
continue-on-error: true

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
!test
2-
README.rst
3-
requirements_optional.txt
2+
uv.lock
3+
profile.*
44

55
# DepHell stuff
66
poetry.lock

.pre-commit-config.yaml

+30-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.3.3
3+
rev: v0.9.6
44
hooks:
55
- id: ruff
66
args: [ --fix ]
77
- id: ruff-format
88

99
- repo: https://github.com/RobertCraigie/pyright-python
10-
rev: v1.1.354
10+
rev: v1.1.394
1111
hooks:
1212
- id: pyright
1313

14-
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
15-
rev: v1.3.3
14+
- repo: local
1615
hooks:
17-
- id: python-safety-dependencies-check
18-
files: pyproject.toml
16+
- id: generate requirements
17+
name: generate requirements
18+
entry: uv export --no-hashes --no-dev -o requirements.txt
19+
language: system
20+
pass_filenames: false
21+
- id: safety
22+
name: safety
23+
entry: uv run safety
24+
language: system
25+
pass_filenames: false
26+
- id: make docs
27+
name: make docs
28+
entry: uv run handsdown --cleanup -o documentation/reference
29+
language: system
30+
pass_filenames: false
31+
- id: build package
32+
name: build package
33+
entry: uv build
34+
language: system
35+
pass_filenames: false
36+
- id: pytest
37+
name: pytest
38+
entry: uv run pytest
39+
language: system
40+
pass_filenames: false
1941

2042
- repo: https://github.com/pre-commit/pre-commit-hooks
21-
rev: v4.5.0
43+
rev: v5.0.0
2244
hooks:
2345
- id: trailing-whitespace
2446
- id: end-of-file-fixer
@@ -35,7 +57,7 @@ repos:
3557
- id: mixed-line-ending
3658

3759
- repo: https://github.com/boidolr/pre-commit-images
38-
rev: v1.5.2
60+
rev: v1.8.4
3961
hooks:
4062
- id: optimize-jpg
4163
- id: optimize-png

immutable.zip

-22 Bytes
Binary file not shown.

mutable.zip

-22 Bytes
Binary file not shown.

pyproject.toml

+31-28
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
1-
[tool.poetry]
1+
[project]
22
name = "mutablezip"
3-
version = "2021"
4-
license = "mit"
3+
version = "2025"
54
description = "Overwrite and remove elements from a zip"
6-
authors = ["FredHappyface"]
5+
authors = [{ name = "FredHappyface" }]
6+
requires-python = "~=3.8"
7+
readme = "README.md"
8+
license = "mit"
79
classifiers = [
8-
"Development Status :: 5 - Production/Stable",
9-
"Intended Audience :: Developers",
10-
"Intended Audience :: Education",
11-
"Natural Language :: English",
12-
"Operating System :: OS Independent",
13-
"Programming Language :: Python :: Implementation :: CPython",
14-
"Topic :: Software Development :: Libraries :: Python Modules",
15-
"Topic :: Utilities"
10+
"Development Status :: 5 - Production/Stable",
11+
"Intended Audience :: Developers",
12+
"Intended Audience :: Education",
13+
"Natural Language :: English",
14+
"Operating System :: OS Independent",
15+
"Programming Language :: Python :: Implementation :: CPython",
16+
"Topic :: Software Development :: Libraries :: Python Modules",
17+
"Topic :: Utilities",
1618
]
17-
homepage = "https://github.com/FHPythonUtils/MutableZip"
18-
repository = "https://github.com/FHPythonUtils/MutableZip"
19-
documentation = "https://github.com/FHPythonUtils/MutableZip/blob/master/README.md"
20-
readme = "README.md"
21-
22-
[tool.poetry.dependencies]
23-
python = "^3.8"
2419

25-
[tool.poetry.group.dev.dependencies]
26-
pytest = "^8.1.1"
27-
handsdown = "^2.1.0"
28-
coverage = "^7.4.4"
29-
ruff = "^0.3.3"
30-
pyright = "^1.1.354"
20+
[project.urls]
21+
Homepage = "https://github.com/FHPythonUtils/MutableZip"
22+
Repository = "https://github.com/FHPythonUtils/MutableZip"
23+
Documentation = "https://github.com/FHPythonUtils/MutableZip/blob/master/README.md"
3124

32-
[build-system]
33-
requires = ["poetry-core"]
34-
build-backend = "poetry.core.masonry.api"
25+
[dependency-groups]
26+
dev = [
27+
"pytest>=8.1.1,<9",
28+
"handsdown>=2.1.0,<3",
29+
"coverage>=7.4.4,<8",
30+
"ruff>=0.3.3,<0.4",
31+
"pyright>=1.1.354,<2",
32+
"safety>=3.3.0",
33+
]
3534

3635
[tool.ruff]
3736
line-length = 100
@@ -83,3 +82,7 @@ env_list =
8382
deps = pytest
8483
commands = pytest tests
8584
"""
85+
86+
[build-system]
87+
requires = ["hatchling"]
88+
build-backend = "hatchling.build"

requirements.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
1+
# This file was autogenerated by uv via the following command:
2+
# uv export --no-hashes --no-dev -o requirements.txt
3+
-e .

tests/data/immutable.zip

432 Bytes
Binary file not shown.

tests/data/mutable.zip

36 Bytes
Binary file not shown.

tests/test_main.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
#!/usr/bin/env python3.9
2-
31
"""tests"""
42

53
from __future__ import annotations
64

7-
import sys
85
from pathlib import Path
96
from zipfile import ZIP_DEFLATED, ZipFile
107

11-
THISDIR = Path(__file__).resolve().parent
12-
sys.path.insert(0, str(THISDIR.parent))
13-
148
from mutablezip import MutableZipFile
159

10+
THISDIR = Path(__file__).resolve().parent
11+
1612

1713
def test_MutableZipFile() -> None:
1814
with MutableZipFile(f"{THISDIR}/data/mutable.zip", "a", compression=ZIP_DEFLATED) as zipFile:

0 commit comments

Comments
 (0)