Skip to content

Commit 021a350

Browse files
committed
migrate to uv
1 parent ac38602 commit 021a350

File tree

6 files changed

+91
-48
lines changed

6 files changed

+91
-48
lines changed

.github/workflows/test-lint.yaml

Lines changed: 6 additions & 5 deletions
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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
README.rst
2-
requirements_optional.txt
3-
downloads/*
41

5-
# DepHell stuff
6-
poetry.lock
2+
downloads/*
3+
uv.lock
74

85
# Byte-compiled / optimized / DLL files
96
__pycache__/

.pre-commit-config.yaml

Lines changed: 30 additions & 8 deletions
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

pyproject.toml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
[tool.poetry]
1+
[project]
22
name = "sigstickers"
3-
version = "2024.1"
4-
license = "mit"
3+
version = "2025"
54
description = "Download sticker packs from Signal"
6-
authors = ["FredHappyface"]
5+
authors = [{ name = "FredHappyface" }]
6+
requires-python = ">=3.8"
7+
readme = "README.md"
8+
license = "mit"
79
classifiers = [
810
"Development Status :: 5 - Production/Stable",
911
"Intended Audience :: Developers",
@@ -15,28 +17,31 @@ classifiers = [
1517
"Topic :: Utilities",
1618
"Topic :: Multimedia :: Graphics",
1719
]
18-
homepage = "https://github.com/FHPythonUtils/SigStickers"
19-
repository = "https://github.com/FHPythonUtils/SigStickers"
20-
documentation = "https://github.com/FHPythonUtils/SigStickers/blob/master/README.md"
21-
readme = "README.md"
20+
dependencies = [
21+
"Pillow<11,>=10.2.0",
22+
"signalstickers-client<4,>=3.3.0",
23+
"emoji<3,>=2.10.1",
24+
"loguru<2,>=0.7.2",
25+
]
2226

23-
[tool.poetry.dependencies]
24-
python = "^3.8"
25-
Pillow = "<11,>=10.2.0"
26-
signalstickers-client = "<4,>=3.3.0"
27-
emoji = "<3,>=2.10.1"
28-
loguru = "<2,>=0.7.2"
27+
[project.urls]
28+
Homepage = "https://github.com/FHPythonUtils/SigStickers"
29+
Repository = "https://github.com/FHPythonUtils/SigStickers"
30+
Documentation = "https://github.com/FHPythonUtils/SigStickers/blob/master/README.md"
2931

30-
[tool.poetry.scripts]
32+
[project.scripts]
3133
sigstickers = "sigstickers:cli"
3234

33-
[tool.poetry.group.dev.dependencies]
34-
pytest = "^8.1.1"
35-
handsdown = "^2.1.0"
36-
coverage = "^7.4.4"
37-
ruff = "^0.3.3"
38-
pyright = "^1.1.354"
39-
pytest-asyncio = "^0.23.5.post1"
35+
[dependency-groups]
36+
dev = [
37+
"pytest>=8.1.1,<9",
38+
"handsdown>=2.1.0,<3",
39+
"coverage>=7.4.4,<8",
40+
"ruff>=0.3.3,<0.4",
41+
"pyright>=1.1.354,<2",
42+
"pytest-asyncio>=0.23.5.post1,<0.24",
43+
"safety>=3.3.0",
44+
]
4045

4146
[tool.ruff]
4247
line-length = 100
@@ -46,7 +51,6 @@ target-version = "py38"
4651
[tool.ruff.lint]
4752
select = ["ALL"]
4853
ignore = [
49-
"ANN101", # type annotation for self in method
5054
"COM812", # enforce trailing comma
5155
"D2", # pydocstyle formatting
5256
"ISC001",
@@ -79,6 +83,8 @@ branch = true
7983
legacy_tox_ini = """
8084
[tox]
8185
env_list =
86+
py313
87+
py312
8288
py311
8389
py310
8490
py39

requirements.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
Pillow<11,>=10.2.0
2-
emoji<3,>=2.10.1
3-
loguru<2,>=0.7.2
4-
signalstickers-client<4,>=3.3.0
1+
# This file was autogenerated by uv via the following command:
2+
# uv export --no-hashes --no-dev -o requirements.txt
3+
anyio==3.7.1
4+
certifi==2025.1.31
5+
cffi==1.17.1
6+
colorama==0.4.6 ; sys_platform == 'win32'
7+
cryptography==3.4.8
8+
emoji==2.14.1
9+
exceptiongroup==1.2.2 ; python_full_version < '3.11'
10+
h11==0.14.0
11+
httpcore==0.17.3
12+
httpx==0.24.1
13+
idna==3.10
14+
loguru==0.7.3
15+
pillow==10.4.0
16+
protobuf==3.20.3
17+
pycparser==2.22
18+
signalstickers-client==3.3.0
19+
sniffio==1.3.1
20+
typing-extensions==4.12.2 ; python_full_version < '3.9'
21+
win32-setctime==1.2.0 ; sys_platform == 'win32'

tests/test_downloader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
from sigstickers.downloader import download_pack
88

99

10-
@pytest.fixture()
10+
@pytest.fixture
1111
def test_data() -> Generator[Path, None, None]:
1212
test_dir = Path("test_data")
1313
yield test_dir
1414
shutil.rmtree(test_dir)
1515

1616

17-
@pytest.mark.asyncio()
17+
@pytest.mark.asyncio
1818
async def test_download_pack(test_data: Path) -> None:
1919
pack_id = "b676ec334ee2f771cadff5d095971e8c"
2020
pack_key = "c957a57000626a2dc3cb69bf0e79c91c6b196b74d4d6ca1cbb830d3ad0ad4e36"
@@ -23,7 +23,7 @@ async def test_download_pack(test_data: Path) -> None:
2323
assert sticker_dir.is_dir()
2424

2525

26-
@pytest.mark.asyncio()
26+
@pytest.mark.asyncio
2727
async def test_download_pack_bad_name(test_data: Path) -> None:
2828
pack_id = "4d92b5e3e92d1ac099830b17ac10793d"
2929
pack_key = "c8526aa2e25b911a405d39c1d4ee3977586e945550fddc33e1316626116da512"

0 commit comments

Comments
 (0)