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: add pinning strategy to the configuration #1516

Merged
merged 16 commits into from
Jul 19, 2024

Conversation

ruben-arts
Copy link
Contributor

@ruben-arts ruben-arts commented Jun 17, 2024

Improve UX for users that want a different pinning strategy in pixi add.

With this pr users can set the strategy they want:

  • semver: 1.2.3 -> >=1.2.3, <2 and 0.1.0 -> >=0.1.0, <0.2 and 0.0.0 -> >=0.0.0, <0.0.1
  • no-pin: 1.2.3 -> *
  • exact-version: 1.2.3 -> ==1.2.3
  • minor: 1.2.3 -> >=1.2.3, <1.3
  • major: 1.2.3 -> >=1.2.3, <2
  • latest-up: 1.2.3 -> >=1.2.3

Users can set it using pixi config set pinning-strategy no-pin.

The pixi add will show what it added to the toml file:

> pixi config set pinning-strategy exact-version
> pixi add starship
Added starship ==1.19.0

Closes #1562

@Hofer-Julian
Copy link
Contributor

Looks good at first glance.
I've opened #1562 since I feel that pin-major should be the default.

@ruben-arts ruben-arts marked this pull request as ready for review July 4, 2024 15:24
@ruben-arts
Copy link
Contributor Author

@Hofer-Julian it should now implement this. In another pr we can also add it to the cli.

I was thinking this might also be a project specific configuration setting. so maybe adding it to the manifest aswell? 🤔

@Hofer-Julian
Copy link
Contributor

@Hofer-Julian it should now implement this. In another pr we can also add it to the cli.

I was thinking this might also be a project specific configuration setting. so maybe adding it to the manifest aswell? 🤔

Awesome, thanks @ruben-arts!
Being able to set the default in the manifest sounds good to me

@baszalmstra
Copy link
Contributor

Cant you already have a pixi config local to the project? Similar to a .cargo/config.toml?

@ruben-arts
Copy link
Contributor Author

Cant you already have a pixi config local to the project? Similar to a .cargo/config.toml?

Yes that is possible, was just a braindump as it might be a conflict prone file. But might not be that bad.

@Hofer-Julian
Copy link
Contributor

Cant you already have a pixi config local to the project? Similar to a .cargo/config.toml?

Yes that is possible, was just a braindump as it might be a conflict prone file. But might not be that bad.

I actually wasn't aware of that one. In that case I'd prefer the config :)

@ruben-arts ruben-arts requested a review from baszalmstra July 9, 2024 15:48
src/cli/add.rs Outdated Show resolved Hide resolved
src/cli/add.rs Outdated Show resolved Hide resolved
src/cli/add.rs Outdated Show resolved Hide resolved
src/cli/add.rs Outdated Show resolved Hide resolved
src/cli/add.rs Outdated Show resolved Hide resolved
@baszalmstra
Copy link
Contributor

Would by nice if you can also have a pixi add --pinning-strategy ..!

@ruben-arts
Copy link
Contributor Author

@baszalmstra, yes!, I would like to merge this first

@baszalmstra baszalmstra merged commit d161328 into prefix-dev:main Jul 19, 2024
28 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.

Let pixi add pin major versions instead of minor versions
3 participants