Skip to content

feat: replace sync_constraints.py with edx_lint write_uv_constraints#359

Merged
bmtcril merged 1 commit intomainfrom
feanil/switch_to_shared_constraint_tooling
Apr 27, 2026
Merged

feat: replace sync_constraints.py with edx_lint write_uv_constraints#359
bmtcril merged 1 commit intomainfrom
feanil/switch_to_shared_constraint_tooling

Conversation

@feanil
Copy link
Copy Markdown
Contributor

@feanil feanil commented Apr 23, 2026

Summary

Replaces the bespoke sync_constraints.py script with the new edx_lint write_uv_constraints command (openedx/edx-lint#537), which is the shared tooling for managing [tool.uv].constraint-dependencies across openedx repos.

What changed

  • Deleted sync_constraints.py and requirements/common_constraints.txt — the script downloaded common_constraints.txt from GitHub and updated pyproject.toml; the downloaded cache is no longer needed since the constraints are bundled inside edx-lint itself.

  • Created constraints.txt — repo-specific constraints file at the repo root. The greenlet pin that was previously hardcoded inside sync_constraints.py lives here now.

  • Updated pyproject.toml — the [tool.uv].constraint-dependencies section is now written by edx_lint write_uv_constraints with a DO NOT EDIT comment. The redundant override-dependencies section (which duplicated the same constraints) has been removed.

  • Updated Makefilesync-constraints replaced; upgrade now runs:

    uv run --with edx-lint edx_lint write_uv_constraints pyproject.toml --local constraints.txt
    uv lock --upgrade
    

    Constraints are written first so that uv lock --upgrade respects them from the start and can't upgrade packages past the new limits. Since edx-lint is not a project dependency here (it's fetched via --with), it's always the latest version regardless of ordering, so there's no need for a separate re-lock step.

    Using uv run --with edx-lint means edx-lint is not a project dependency — uv fetches the latest version in an ephemeral environment each time, so new global constraints are picked up automatically on the next make upgrade.

Dependency

Requires openedx/edx-lint#537 to be merged and released before make upgrade will work end-to-end. The constraint-dependencies in pyproject.toml was pre-populated using the development version of that branch.

Switches constraint management from the bespoke sync_constraints.py script
(which downloaded common_constraints.txt from GitHub via HTTP) to the new
`edx_lint write_uv_constraints` command added in openedx/edx-lint#537.

The new approach:
- Uses the constraints bundled inside the installed edx-lint package, so no
  network call is needed at upgrade time
- Merges repo-specific constraints from constraints.txt (replaces the greenlet
  pin that was hardcoded inside sync_constraints.py)
- Local pins can override global ones by package name, which is useful when
  testing against a specific version
- Writes a DO NOT EDIT comment block on first run and preserves it on
  subsequent runs

The requirements/common_constraints.txt download cache is removed since the
bundled copy inside edx-lint is now the authoritative source.

Requires edx-lint >= next release (openedx/edx-lint#537).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@feanil feanil force-pushed the feanil/switch_to_shared_constraint_tooling branch from e2e5f45 to 04d9274 Compare April 27, 2026 14:01
@feanil
Copy link
Copy Markdown
Contributor Author

feanil commented Apr 27, 2026

@bmtcril edx-lint has published 6.1.0 with the new command, this should now be safe to merge

@bmtcril bmtcril merged commit a26f270 into main Apr 27, 2026
3 checks passed
@bmtcril bmtcril deleted the feanil/switch_to_shared_constraint_tooling branch April 27, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants