Skip to content

Conversation

@kurtrwall
Copy link

@kurtrwall kurtrwall commented Dec 11, 2025

What does this PR do?

What issues does this PR fix or reference?

Fixes #68525

Previous Behavior

Python packages installed in an environment would not upgrade to their pre-release version when any exist in the index.

New Behavior

Pre-release versions of packages managed by pip.installed state are upgraded when using upgrade=True and pre_releases=True.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

@kurtrwall kurtrwall requested a review from a team as a code owner December 11, 2025 02:17
@kurtrwall kurtrwall force-pushed the fix-pip-install-prerelease-upgrade branch from 16ddd3a to 2a05161 Compare December 11, 2025 02:18
@kurtrwall kurtrwall changed the base branch from master to 3005.x December 11, 2025 02:19
@kurtrwall kurtrwall requested a review from a team as a code owner December 11, 2025 02:19
@kurtrwall kurtrwall requested review from dwoz and removed request for a team December 11, 2025 02:19
@kurtrwall
Copy link
Author

I've been able to trace the bug back to the inception of the code that uses pip index versions, so I based the PR on the v3004.x branch, but I'm unsure if that was the appropriate one.

I'm also having a bit of trouble with the tests, but I didn't want it to block the contribution.

@twangboy
Copy link
Contributor

We do bug fixes on the olders supported branch where the bug exists. There will be no more releases of 3004 and 3005. The oldest supported branch is 3006.x. Please rebase this PR on 3006.x.
Also, please create a changelog for this PR.
https://docs.saltproject.io/en/3006/topics/development/changelog.html

`pip index versions` will never yield pre-release versions of the
package without the `--pre` option.

In effect, this means providing `pre_releases=True` and `upgrade=True`
to the `pip.installed` state will never work, but I'm unsure of the
actual extent of this bug.
@kurtrwall kurtrwall force-pushed the fix-pip-install-prerelease-upgrade branch from 2a05161 to 7a239d1 Compare December 11, 2025 17:55
@kurtrwall
Copy link
Author

Rebased to 3006.x and refactored the test a bit to utililze the new fixtures and provide more coverage.

@kurtrwall kurtrwall force-pushed the fix-pip-install-prerelease-upgrade branch from 6213954 to 2af6443 Compare December 11, 2025 18:11
@twangboy twangboy changed the base branch from 3005.x to 3006.x December 11, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: pip.installed state will not upgrade to pre-releases

2 participants