Skip to content

Commit 4e95632

Browse files
salman2013claude
andcommitted
chore: switch dependency management from pip-tools to uv
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 371b251 commit 4e95632

6 files changed

Lines changed: 135 additions & 56 deletions

File tree

.github/workflows/python-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
- name: Install uv
3030
uses: astral-sh/setup-uv@v6
3131

32+
- name: Install CI dependencies
33+
run: uv sync --group ci
34+
3235
- name: Run tests with Tox (${{ matrix.toxenv }})
3336
env:
3437
TOXENV: ${{ matrix.toxenv }}

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
- name: Install uv
2626
uses: astral-sh/setup-uv@v6
2727

28+
- name: Install CI dependencies
29+
run: uv sync --group ci
30+
2831
- name: Run tests (${{ matrix.toxenv }})
2932
env:
3033
TOXENV: ${{ matrix.toxenv }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ help:
1414
@perl -nle'print $& if m{^[\.a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'
1515

1616
upgrade: ## update uv.lock and regenerate uv constraints from edx-lint
17-
edx_lint write_uv_constraints
17+
uv run --with edx-lint edx_lint write_uv_constraints pyproject.toml
1818
uv lock --upgrade
1919

2020
requirements: ## install development environment requirements using uv

pyproject.toml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ keywords = ["Python", "edx"]
1616
classifiers = [
1717
"Development Status :: 3 - Alpha",
1818
"Intended Audience :: Developers",
19-
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
2019
"Natural Language :: English",
2120
"Programming Language :: Python :: 3",
2221
"Programming Language :: Python :: 3.12",
@@ -87,27 +86,36 @@ test-base = [
8786
"pytest-django",
8887
"six",
8988
]
90-
test = [{ include-group = "test-base" }]
89+
# Current default Django version. When adding or retiring a Django version
90+
# from the matrix, update this group and [tool.uv].conflicts accordingly.
91+
test = [
92+
{ include-group = "test-base" },
93+
"Django>=5.2,<6.0",
94+
]
95+
django42 = [
96+
{ include-group = "test-base" },
97+
"Django>=4.2,<5.0",
98+
]
9199
quality = [
100+
{ include-group = "test" },
92101
"edx-lint",
93102
"isort",
94103
"pycodestyle",
95104
"pydocstyle",
96105
"pylint",
97106
]
98107
doc = [
99-
{ include-group = "test-base" },
108+
{ include-group = "test" },
100109
"doc8",
101110
"Sphinx",
102111
"sphinx-book-theme",
103112
]
104113
ci = [
105-
{ include-group = "test" },
106-
{ include-group = "quality" },
107114
"tox",
108115
"tox-uv",
109116
]
110117
dev = [
118+
{ include-group = "quality" },
111119
{ include-group = "ci" },
112120
{ include-group = "doc" },
113121
]
@@ -158,6 +166,12 @@ ignore = ["D001"]
158166

159167
[tool.uv]
160168
package = true
169+
# Each entry lists groups with mutually exclusive version requirements so uv
170+
# can produce a single uv.lock with a separate resolution for each.
171+
# Add a new pair whenever you add a legacy-version group to [dependency-groups].
172+
conflicts = [
173+
[{ group = "test" }, { group = "django42" }],
174+
]
161175
# DO NOT EDIT constraint-dependencies DIRECTLY.
162176
# This list is managed by `edx_lint write_uv_constraints`
163177
# and will be overwritten the next time `make upgrade` is run.

tox.ini

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@ max-line-length = 120
1111
match-dir = (?!migrations)
1212

1313
[testenv]
14-
# uv-venv-runner (not lock-runner) is used here so that factor-conditional
15-
# Django version deps can be applied per environment without conflicting in
16-
# the shared uv.lock.
17-
runner = uv-venv-runner
14+
runner = uv-venv-lock-runner
1815
setenv =
1916
PYTHONPATH = {toxinidir}
2017
DJANGO_SETTINGS_MODULE = test_settings
21-
dependency_groups = test
22-
deps =
23-
django42: Django>=4.2,<5.0
24-
django52: Django>=5.2,<6.0
18+
dependency_groups =
19+
django42: django42
20+
django52: test
2521
allowlist_externals =
2622
mkdir
2723
commands =

0 commit comments

Comments
 (0)