Skip to content

Conversation

@feanil
Copy link
Contributor

@feanil feanil commented Nov 14, 2025

Previously we would upgrade pip before we upgrade pip-tools. This
breaks when the latest version of pip is not compatible with the current
version of pip-tools as happened with jazzband/pip-tools#2252

If we re-order the steps so that we upgrade pip-tools first, we know
that this upgrade call will work since it will run with the versions of
pip and pip-compile that ran the last full upgrade.

However in this case the pip.txt file is redundant as the pip-tools.txt
file already has the latest version of pip that is compatible with the
current version of pip-tools being installed.

This changeset also updates the compile-requirements command to ignore
the common_constraints entry for pip so that we can verify the upstream
fix of pip-compile before we remove the entry from
common_constraints.txt upstream.

@feanil feanil requested a review from timmc-edx November 14, 2025 16:29
@feanil
Copy link
Contributor Author

feanil commented Nov 14, 2025

@timmc-edx I feel like you've thought about this a bit before so I'd love your thoughts on this change if you have a sec for it. Though, review from others is also welcome.

@feanil feanil requested review from a team and kdmccormick November 17, 2025 14:17
@timmc-edx
Copy link
Contributor

I'm having some trouble seeing the logic here. Won't this still break during a period of incompatible latest/latest? Or is the idea that pip-tools will constrain the pip version somehow and ensure we get a compatible pair?

@feanil
Copy link
Contributor Author

feanil commented Nov 18, 2025

The pip-tools.txt file has a pip version in it that is compatible with that version of pip-tools. So the initial install of pip-tools should always install co-compatible versions of both. Then we attempt to upgrade both.

@timmc-edx
Copy link
Contributor

In a situation where latest of pip and pip-tools are incompatible, I would predict the following:

  • We upgrade and install pip-tools.txt, bringing in the max compatible pip version.
  • We then upgrade and install pip.txt, bringing in a newer (incompatible) pip.
  • We then proceed with pip-compile commands, which break.

What am I missing here?

@timmc-edx
Copy link
Contributor

...actually, why have pip.txt at all if pip-tools.txt includes it?

@feanil
Copy link
Contributor Author

feanil commented Nov 18, 2025

Yea, I was thinking about that too, like do we need both? Thinking about it more, the pip-compile of pip-tools.txt should upgrade both so yea maybe we can just drop that. Let me make that change.

Previously we would upgrade pip before we upgrade pip-tools.  This
breaks when the latest version of pip is not compatible with the current
version of pip-tools as happened with jazzband/pip-tools#2252

If we re-order the steps so that we upgrade pip-tools first, we know
that this upgrade call will work since it will run with the versions of
pip and pip-compile that ran the last full upgrade.

However in this case the pip.txt file is redundant as the pip-tools.txt
file already has the latest version of pip that is compatible with the
current version of pip-tools being installed.

This changeset also updates the compile-requirements command to ignore
the common_constraints entry for pip so that we can verify the upstream
fix of pip-compile before we remove the entry from
common_constraints.txt upstream.
Use the `pre-requirements` target to ensure that pip is installed at a
version that's valid for the rest of the workflow.
@feanil feanil force-pushed the feanil/fix_make_upgrade branch from 647ad0e to 6f37e0b Compare November 19, 2025 16:52
Copy link
Contributor

@timmc-edx timmc-edx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just needs updated PR title/desc.

@feanil feanil changed the title build: Change requirements compilation order. build: Don't have both a pip and pip-tools requirements files. Nov 20, 2025
@feanil feanil merged commit 53b5a8b into master Nov 20, 2025
53 checks passed
@feanil feanil deleted the feanil/fix_make_upgrade branch November 20, 2025 14:36
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.

3 participants