Skip to content

Commit 4fc4950

Browse files
Copilotnorkans7
andcommitted
Switch to uv Python package manager
Co-authored-by: norkans7 <1040571+norkans7@users.noreply.github.com>
1 parent 626646c commit 4fc4950

File tree

4 files changed

+1268
-31
lines changed

4 files changed

+1268
-31
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,24 @@ jobs:
3333
with:
3434
python-version: ${{ matrix.python-version }}
3535

36-
- name: Install Poetry
37-
uses: snok/install-poetry@v1
38-
with:
39-
virtualenvs-in-project: true
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v5
4038

4139
- name: Initialize environment
4240
run: |
43-
poetry install --no-root
44-
poetry add django@~${{ matrix.django-version }}
41+
uv sync --extra dev
42+
uv add django@~${{ matrix.django-version }}
4543
4644
- name: Run pre-test checks
4745
run: |
4846
sudo apt-get install gettext
49-
poetry run python ./code_check.py --debug
47+
uv run python ./code_check.py --debug
5048
5149
- name: Run tests
5250
run: |
53-
poetry run coverage run manage.py test dash test_runner --verbosity=2
54-
poetry run coverage report -i
55-
poetry run coverage xml
51+
uv run coverage run manage.py test dash test_runner --verbosity=2
52+
uv run coverage report -i
53+
uv run coverage xml
5654
5755
- name: Upload coverage
5856
if: success()
@@ -73,11 +71,12 @@ jobs:
7371
- name: Install Python
7472
uses: actions/setup-python@v5
7573
with:
76-
python-version: "3.10.x"
74+
python-version: "3.11.x"
75+
76+
- name: Install uv
77+
uses: astral-sh/setup-uv@v5
7778

7879
- name: Publish release
7980
run: |
80-
python -m pip install -U pip poetry
81-
poetry build
82-
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
83-
poetry publish
81+
uv build
82+
uv publish --token ${{ secrets.PYPI_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,5 @@ fabfile.*
6969
# ruff
7070
.ruff_cache
7171

72+
# uv
73+
.venv/

pyproject.toml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,22 @@ dependencies = [
2929
"rapidpro-python (>=2.21.0,<3.0.0)",
3030
"smartmin (>=5.2.2,<6.0.0)",
3131
"sorl-thumbnail >= 12.9.0",
32-
"isort[pyproject] >= 5.13.2",
32+
"isort >= 5.13.2",
3333
"django-valkey (>=0.2.1,<0.3.0)",
3434
]
3535

36-
[tool.poetry]
37-
packages = [
38-
{ include = "dash" },
36+
[project.optional-dependencies]
37+
dev = [
38+
"black >= 24.3.0",
39+
"isort >= 5.13.2",
40+
"colorama >= 0.4.3",
41+
"coverage[toml] >= 7.2.2",
42+
"ruff >= 0.3.3",
43+
"djlint >= 1.34.1",
3944
]
4045

41-
[tool.poetry.urls]
42-
"Repository" = "http://github.com/rapidpro/dash"
43-
44-
[tool.poetry.group.dev.dependencies]
45-
black = "^24.3.0"
46-
isort = "^5.13.2"
47-
colorama = "^0.4.3"
48-
coverage = {extras = ["toml"], version = "^7.2.2"}
49-
ruff = "^0.3.3"
50-
djlint = "^1.34.1"
46+
[project.urls]
47+
Repository = "http://github.com/rapidpro/dash"
5148

5249
[tool.black]
5350
line-length = 119
@@ -77,5 +74,8 @@ source = ["dash"]
7774
omit = ["*/migrations/*", "*/tests*", "*__init__*", "*settings*", "*management/commands*", "dash/test.py"]
7875

7976
[build-system]
80-
requires = ["poetry-core>=2.0.0,<3.0.0"]
81-
build-backend = "poetry.core.masonry.api"
77+
requires = ["hatchling"]
78+
build-backend = "hatchling.build"
79+
80+
[tool.hatch.build.targets.wheel]
81+
packages = ["dash"]

0 commit comments

Comments
 (0)