Skip to content

Commit 3dd021c

Browse files
feanilclaude
andcommitted
feat: add dependency groups and static deps to pyproject.toml
Replaces dynamically-loaded dependencies (from requirements/base.in) with a static [project].dependencies list, and adds [dependency-groups] (PEP 735) covering test/quality/doc/ci/dev groups. Also adds [tool.uv].constraint-dependencies (machine-managed via edx_lint write_uv_constraints) and creates constraints.txt as the hook for future repo-specific pins. The .in files are removed since [dependency-groups] replaces them. The compiled .txt lockfiles are removed in a follow-up commit together with the uv.lock. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 00d6874 commit 3dd021c

10 files changed

Lines changed: 64 additions & 66 deletions

File tree

backend/constraints.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Repo-specific version constraints for this package.
2+
#
3+
# Add package version constraints that are specific to this repo here.
4+
# This file is merged with edx-lint's global constraints by `make upgrade`.
5+
#
6+
# Format: one PEP 440 specifier per line, comments starting with # are ignored.
7+
# Example:
8+
# somepackage<3.0 # reason this pin is needed

backend/pyproject.toml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,17 @@ keywords = [
2424
"edx",
2525
]
2626

27-
dynamic = ["readme", "dependencies", "version"]
27+
dynamic = ["readme", "version"]
28+
29+
dependencies = [
30+
"Django",
31+
"djangorestframework",
32+
"django-filter",
33+
"edx-opaque-keys",
34+
"openedx-events",
35+
"openedx-filters",
36+
"openedx-atlas",
37+
]
2838

2939
[project.entry-points."lms.djangoapp"]
3040
sample_plugin = "sample_plugin.apps:SamplePluginConfig"
@@ -36,9 +46,42 @@ sample_plugin = "sample_plugin.apps:SamplePluginConfig"
3646
Homepage = "https://openedx.org/openedx/sample-plugin"
3747
Repository = "https://openedx.org/openedx/sample-plugin"
3848

49+
[dependency-groups]
50+
test = [
51+
"pytest-cov",
52+
"pytest-django",
53+
"code-annotations",
54+
"edx-django-utils",
55+
"django-extensions",
56+
]
57+
quality = [
58+
{include-group = "test"},
59+
"edx-lint",
60+
"isort",
61+
"pycodestyle",
62+
"pydocstyle",
63+
]
64+
doc = [
65+
{include-group = "test"},
66+
"doc8",
67+
"sphinx-book-theme",
68+
"twine",
69+
"build",
70+
"Sphinx",
71+
]
72+
ci = [
73+
"tox",
74+
"tox-uv",
75+
]
76+
dev = [
77+
{include-group = "quality"},
78+
{include-group = "ci"},
79+
"diff-cover",
80+
"edx-i18n-tools",
81+
]
82+
3983
[tool.setuptools.dynamic]
4084
readme = {file = ["README.md"], content-type = "text/markdown" }
41-
dependencies = {file = "requirements/base.in"}
4285

4386
[tool.setuptools.packages.find]
4487
include = ["sample_plugin*"]
@@ -62,3 +105,14 @@ minor_tags = ["feat", "docs"]
62105
root = ".."
63106
version_scheme = 'only-version'
64107
local_scheme = 'no-local-version'
108+
109+
[tool.uv]
110+
# DO NOT EDIT constraint-dependencies DIRECTLY.
111+
# This list is managed by `edx_lint write_uv_constraints`
112+
# and will be overwritten the next time `make upgrade` is run.
113+
# - GLOBAL constraints: edit edx_lint/files/common_constraints.txt
114+
# - REPO-SPECIFIC constraints: edit constraints.txt next to pyproject.toml
115+
constraint-dependencies = [
116+
"Django<6.0",
117+
"elasticsearch<7.14.0",
118+
]

backend/requirements/base.in

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

backend/requirements/ci.in

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

backend/requirements/dev.in

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

backend/requirements/doc.in

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

backend/requirements/pip-tools.in

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

backend/requirements/pip.in

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

backend/requirements/quality.in

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

backend/requirements/test.in

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

0 commit comments

Comments
 (0)