Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 5 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
compile-requirements detect_changed_source_translations dev-requirements \
docs extract_translations \
guides help lint-imports local-requirements migrate migrate-lms migrate-cms \
pre-requirements pull pull_xblock_translations pull_translations push_translations \
pull pull_xblock_translations pull_translations push_translations \
requirements shell swagger \
technical-docs test-requirements ubuntu-requirements upgrade-package upgrade

Expand Down Expand Up @@ -64,9 +64,6 @@ pull_translations: clean_translations ## pull translations via atlas
detect_changed_source_translations: ## check if translation files are up-to-date
i18n_tool changed

pre-requirements: ## install Python requirements for running pip-tools (still needed for scripts/*, which aren't on uv yet)
pip install -r requirements/pip-tools.txt

local-requirements: ## no-op; `uv sync` (used by the targets below) already installs -e . itself
@true

Expand All @@ -90,18 +87,7 @@ requirements: dev-requirements ## install development environment requirements
# explicitly in compile-requirements below rather than through one generic
# loop over a shared list.

define COMMON_CONSTRAINTS_TEMP_COMMENT
# This is a temporary solution to override the real common_constraints.txt\n# In edx-lint, until the pyjwt constraint in edx-lint has been removed.\n# See BOM-2721 for more details.\n# Below is the copied and edited version of common_constraints\n
endef

COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
curl -L https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt > "$(@)"
printf "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@)

compile-requirements: export CUSTOM_COMPILE_COMMAND=make upgrade
compile-requirements: pre-requirements ## Regenerate uv.lock for the root project, and re-compile *.in requirements for the not-yet-migrated sub-projects above
compile-requirements: ## Regenerate uv.lock for the root project and all uv sub-projects
uv run --no-project --with edx-lint edx_lint write_uv_constraints pyproject.toml
uv lock ${UV_LOCK_OPTS}

Expand Down Expand Up @@ -131,11 +117,6 @@ compile-requirements: pre-requirements ## Regenerate uv.lock for the root projec
uv export --frozen --no-hashes --group dev --no-emit-project; \
} > requirements/edx/development.txt

sed 's/Django<5.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
sed 's/pip<25.3//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt

@# requirements/edx-sandbox and scripts/xblock: single compat export, no dependency-groups.
@for d in requirements/edx-sandbox scripts/xblock; do \
echo ; \
Expand Down Expand Up @@ -180,12 +161,12 @@ compile-requirements: pre-requirements ## Regenerate uv.lock for the root projec
} > $$d/requirements/testing.txt; \
done

upgrade: $(COMMON_CONSTRAINTS_TXT) ## update all dependencies (uv.lock for the root project and all uv sub-projects) to the latest releases satisfying our constraints
$(MAKE) compile-requirements COMPILE_OPTS="--upgrade" UV_LOCK_OPTS="--upgrade"
upgrade: ## update all dependencies (uv.lock for the root project and all uv sub-projects) to the latest releases satisfying our constraints
$(MAKE) compile-requirements UV_LOCK_OPTS="--upgrade"

upgrade-package: ## update just one package to the latest usable release
@test -n "$(package)" || { echo "\nUsage: make upgrade-package package=...\n"; exit 1; }
$(MAKE) compile-requirements COMPILE_OPTS="--upgrade-package $(package)" UV_LOCK_OPTS="--upgrade-package $(package)"
$(MAKE) compile-requirements UV_LOCK_OPTS="--upgrade-package $(package)"

check-types: ## run static type-checking tests
mypy
Expand Down
17 changes: 7 additions & 10 deletions requirements/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ The main application's Python dependencies are declared in the root
and ``[tool.edx_lint].uv_constraints`` for repo-specific version pins) and
locked in the root ``uv.lock``, managed with `uv`_.

This ``requirements/`` directory now only holds:
This ``requirements/`` directory now only holds ``edx-sandbox``, its own
standalone ``uv``-managed project (``pyproject.toml`` + ``uv.lock``) for
Codejail's isolated sandbox environment.

- ``edx-sandbox``, its own standalone ``uv``-managed project (``pyproject.toml`` +
``uv.lock``) for Codejail's isolated sandbox environment
- ``constraints.txt`` / ``common_constraints.txt`` / ``pip-tools.in`` / ``pip-tools.txt``,
now unused leftovers from the pip-compile era, pending removal (tracked in
`public-engineering#543`_)

The three standalone script directories (``scripts/xblock``,
The three standalone script directories at the repo root (``scripts/xblock``,
``scripts/user_retirement``, ``scripts/structures_pruning``) each have their
own ``pyproject.toml`` + ``uv.lock`` too, independent of both the main app and
each other.
each other. This completes the migration from pip-compile tracked in
`public-engineering#543`_.

All of these are manipulated using the Makefile targets below in a Linux
environment (to match our build and deploy systems); for developers on Mac,
Expand Down Expand Up @@ -47,7 +44,7 @@ Want to upgrade just *one* dependency without pulling in other upgrades? You can

Or, if you need to do it locally, you can use the ``upgrade-package`` make target directly. For example, you could run ``make upgrade-package package=ecommerce``.

If your dependency is pinned in constraints.txt, you'll need to enter an explicit version number in the appropriate field when running the workflow; this will include an update to the constraint file in the resulting PR.
If your dependency is pinned in ``[tool.edx_lint].uv_constraints`` (in ``pyproject.toml``), you'll need to enter an explicit version number in the appropriate field when running the workflow; this will include an update to that constraint in the resulting PR.

Downgrade a dependency
======================
Expand Down
24 changes: 0 additions & 24 deletions requirements/common_constraints.txt

This file was deleted.

152 changes: 0 additions & 152 deletions requirements/constraints.txt

This file was deleted.

12 changes: 0 additions & 12 deletions requirements/pip-tools.in

This file was deleted.

30 changes: 0 additions & 30 deletions requirements/pip-tools.txt

This file was deleted.

Loading