Skip to content

Commit d546d22

Browse files
author
remimd
committed
feat: ✨ Migrate to uv
1 parent fa147a8 commit d546d22

File tree

9 files changed

+1017
-999
lines changed

9 files changed

+1017
-999
lines changed

.github/actions/code-style/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ runs:
77
- name: Ruff
88
shell: bash
99
run: |
10-
ruff format --check
11-
ruff check
10+
uv run ruff format --check
11+
uv run ruff check
1212
1313
- name: MyPy
1414
shell: bash
15-
run: mypy ./
15+
run: uv run mypy ./

.github/actions/deploy/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ runs:
1111
- name: Publish
1212
shell: bash
1313
run: |
14-
poetry version ${{ inputs.version }}
15-
poetry publish --build
14+
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version ${{ inputs.version }}
15+
uv build
16+
uv publish

.github/actions/environment/action.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,11 @@ inputs:
99
runs:
1010
using: "composite"
1111
steps:
12-
- name: Install Python
13-
uses: actions/setup-python@v5
12+
- name: Install UV
13+
uses: astral-sh/setup-uv@v5
1414
with:
1515
python-version: ${{ inputs.python-version }}
16-
architecture: "x64"
1716

18-
- name: Install Poetry & Dependencies
17+
- name: Install Dependencies
1918
shell: bash
20-
run: |
21-
pip install --upgrade pip
22-
pip install poetry
23-
poetry config virtualenvs.create false
24-
poetry check
25-
poetry install --compile
19+
run: uv sync

.github/actions/tests/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ runs:
66
steps:
77
- name: Pytest
88
shell: bash
9-
run: pytest
9+
run: uv run pytest

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
with:
2222
version: ${{ github.event.release.tag_name }}
2323
env:
24-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
24+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
before_commit: check lint mypy pytest
2-
3-
check:
4-
poetry check
1+
before_commit: lint mypy pytest
52

63
install:
7-
poetry install --sync
4+
uv sync
85

96
lint:
10-
ruff format
11-
ruff check --fix
7+
uv run ruff format
8+
uv run ruff check --fix
129

1310
mypy:
14-
mypy ./
11+
uv run mypy ./
1512

1613
pytest:
17-
pytest
14+
uv run pytest

poetry.lock

Lines changed: 0 additions & 946 deletions
This file was deleted.

pyproject.toml

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[dependency-groups]
6+
bench = [
7+
"tabulate",
8+
"typer",
9+
"types-tabulate",
10+
]
11+
dev = [
12+
"hatch",
13+
"mypy",
14+
"ruff",
15+
]
16+
example = [
17+
"argon2-cffi",
18+
"faker",
19+
"pydantic",
20+
]
21+
test = [
22+
"fastapi",
23+
"httpx",
24+
"pydantic",
25+
"pytest",
26+
"pytest-asyncio",
27+
"pytest-cov",
28+
]
29+
130
[project]
231
name = "python-injection"
332
version = "0.0.0"
433
description = "Fast and easy dependency injection framework."
5-
license = "MIT"
34+
license = { text = "MIT" }
635
readme = "README.md"
736
requires-python = ">=3.12, <4"
837
authors = [{ name = "remimd" }]
@@ -24,32 +53,16 @@ classifiers = [
2453
dependencies = []
2554

2655
[project.urls]
27-
repository = "https://github.com/100nm/python-injection"
28-
29-
[tool.poetry]
30-
packages = [{ include = "injection" }]
56+
Repository = "https://github.com/100nm/python-injection"
3157

32-
[tool.poetry.group.dev.dependencies]
33-
mypy = "*"
34-
ruff = "*"
58+
[tool.hatch.build]
59+
skip-excluded-dirs = true
3560

36-
[tool.poetry.group.test.dependencies]
37-
fastapi = "*"
38-
httpx = "*"
39-
pydantic = "*"
40-
pytest = "*"
41-
pytest-asyncio = "*"
42-
pytest-cov = "*"
61+
[tool.hatch.build.targets.sdist]
62+
include = ["injection"]
4363

44-
[tool.poetry.group.example.dependencies]
45-
argon2-cffi = "*"
46-
faker = "*"
47-
pydantic = "*"
48-
49-
[tool.poetry.group.bench.dependencies]
50-
tabulate = "*"
51-
typer = "*"
52-
types-tabulate = "*"
64+
[tool.hatch.build.targets.wheel]
65+
packages = ["injection"]
5366

5467
[tool.coverage.report]
5568
exclude_lines = [
@@ -106,6 +119,6 @@ extend-select = ["F", "I", "N"]
106119
ignore = ["N818"]
107120
fixable = ["ALL"]
108121

109-
[build-system]
110-
requires = ["poetry-core"]
111-
build-backend = "poetry.core.masonry.api"
122+
[tool.uv]
123+
default-groups = ["bench", "dev", "example", "test"]
124+
package = true

uv.lock

Lines changed: 959 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)