Skip to content

feat: implement pypi pre-release support#4984

Merged
tdejager merged 9 commits intoprefix-dev:mainfrom
tdejager:feat/implement-pypi-pre-release-support
Dec 1, 2025
Merged

feat: implement pypi pre-release support#4984
tdejager merged 9 commits intoprefix-dev:mainfrom
tdejager:feat/implement-pypi-pre-release-support

Conversation

@tdejager
Copy link
Contributor

@tdejager tdejager commented Nov 26, 2025

Description

This exposes the uv pre-release config so that can allow for them even if they are not explicitly specified.

See the issue that this fixes for some motivation.

Fixes #1291

How Has This Been Tested?

There are some automated tests, one of which creates an integration test that creates an pre-release that should be selected.

 [workspace]
 name = "test-prerelease"
 channels = ["conda-forge"]
 platforms = ["osx-arm64", "osx-64", "linux-64"]
 [pypi-options]
 prerelease-mode = "allow"
 [dependencies]
 python = ">=3.11"
 [pypi-dependencies]
 httpx = "*"

Tested that this selects the dev httpx version.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
      Clause Opus 4.5

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

Draft status

We need a rattler_lock update to save the pre-release flag per environment. This is here: conda/rattler#1889

@tdejager tdejager marked this pull request as ready for review November 28, 2025 15:29
Copy link
Contributor

@nichmor nichmor left a comment

Choose a reason for hiding this comment

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

awesome!

let channel = package_db.into_channel().await.unwrap();
let channel_url = channel.url();

// With prerelease-mode = "allow", the resolver should pick the pre-release 2.0.0a1
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it makes sense to have a first test where we don't set any prerelease modes, and expect to get a simple 1.0.0 version?

Copy link
Contributor Author

@tdejager tdejager Dec 1, 2025

Choose a reason for hiding this comment

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

Other tests would've failed 🙂 But we could if you want :) Does the test_prerelease_mode dissallow cover enough? Would we not be testing uv functionality basically otherwise?

)]
#[strum(serialize_all = "kebab-case")]
#[serde(rename_all = "kebab-case")]
pub enum PrereleaseMode {
Copy link
Contributor

Choose a reason for hiding this comment

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

could we import this type from rattler-lock? or we declare a new one to create macros over it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I tried this but because that crate is optional this essentially makes rattler_lock required for these versions. This is the way we are handling this for other types as well, so makes sense to keep it for this? Wdyt? Also, in this case a macro would duplicate with just an abstraction I'd say.

@tdejager tdejager merged commit 43f4867 into prefix-dev:main Dec 1, 2025
42 checks passed
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.

Expose uv config for pre-releases

3 participants