Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow specifying whether you want sdists or not #81

Merged
merged 4 commits into from
Nov 17, 2023

Conversation

baszalmstra
Copy link
Contributor

This adds the option to specify whether you want to use sdists, prefer them or only use sdists.

@notatallshaw
Copy link

notatallshaw commented Nov 16, 2023

you want to use sdists, prefer them or only use sdists

Sorry, I've not quite got the hang of reading Rust PRs yet, but please make sure there's an option for "prefer not to use them",and IMO that should be the default option), if that in fact is not already the case here (perhaps that is what is meant implictly by "you want to use sdists").

@baszalmstra
Copy link
Contributor Author

This PR adds the following options:

  • Normal (the default): this means we consider any version that has wheels and/or sdists and we sort them based on version.
  • PreferWheels: this means we still consider both sdists and wheels but only if no version could be found that has wheels we consider versions with an sdist.
  • PreferSdists: this is the opposite of the above. We consider versions with both artifacts but select a version with a sdist over that with a wheel.
  • OnlyWheels: dont take sdists into consideration at all, only wheels. No solution is found if there are no wheels.
  • OnlySDists: dont take wheels into consideration at all, only sdists. No solution is found if there are no sdists.

Do you think that suffices?

@notatallshaw
Copy link

Options seem great, but the default comes with a lot of nuance and introduces backwards compatability issues if you need to change much later down the road.

I would personally suggest PreferWheels, a wheel is less likely to have issues than an sdist, and this option is only going to go wrong if a project goes from publishing wheels to only publishing sdists, which would be highly unusual.

There's bewen a discussion in Pip world about changing the default and the problem with backwards compatability for them: pypa/pip#9140 (sorry long discussion)

crates/rattler_installs_packages/src/resolve.rs Outdated Show resolved Hide resolved
@tdejager
Copy link
Contributor

tdejager commented Nov 17, 2023

Hi @notatallshaw thanks for your input! I don't mind preferring wheels if you (as the expert :)) says it's a better idea!

@tdejager
Copy link
Contributor

wheels to only publishing sdists, which would be highly unusual.

Like here 😢 : https://pypi.org/simple/pysdl2/

@baszalmstra
Copy link
Contributor Author

@tdejager I added thorough docs to the SDistResolution struct. WDYT?

@baszalmstra
Copy link
Contributor Author

@pradyunsg what do you think of these options? What do you think should be the default here?

@notatallshaw
Copy link

Like here 😢 : https://pypi.org/simple/pysdl2/

Oh wow, 🙁, well Normal is definetly universally safe for rip. But the common example of user pain is when there's a new release and wheels are not released along side sdists immediatly.

@wolfv wolfv dismissed tdejager’s stale review November 17, 2023 15:53

Bas has fixed the wording

@wolfv wolfv merged commit 66cd42a into prefix-dev:main Nov 17, 2023
5 checks passed
@pradyunsg
Copy link

what do you think of these options?

They're reasonable, although given that you have low backwards compatibility costs; I suggest using more granular control (eg: enabling people to say "get me X, Y&Z from an sdist with everything else being wheels".

What do you think should be the default here?

Matching pip's default semantic of "use a wheel if available for a version, otherwise sdist for that version" is likely going to be the most compatible with existing user workflows.

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.

5 participants