Skip to content

set locked in config.toml or pyproject.toml #2628

Open

Description

@adrinjalali

I'd like to be able to set locked=true on the repo so that the lock file only gets updated when intended. Right now one can only pass that as an argument to the commands like pixi run -e ci-sklearn15 --locked tests (context: skops-dev/skops#451).

Also, right now when passing --locked and the env config is changed, it says

$ pixi run -e ci-sklearn15 --locked tests
  × lock-file not up-to-date with the project

It'd be nice to either have an option which only updates the lock file when the environment info is changed, or to ask the user for confirmation.

Activity

  1. ruben-arts commented on Dec 3, 2024

    @ruben-arts
    Contributor

    Hey @adrinjalali,

    I assume what you're looking for is --frozen that will not try to update the lockfile and will continue as previously installed.

  2. adrinjalali commented on Dec 3, 2024

    @adrinjalali
    Author

    Yes, but it still cannot be set in a configuration file, which I'd need if I'm to share a project with new collaborators.

  3. ruben-arts commented on Dec 3, 2024

    @ruben-arts
    Contributor

    Right, we're thinking more and more about how to make pixi a more flexible for this use-case. You think configuring something in the in manifest to skip solving would be the fix for your issues? Should it also stop locking on pixi add and pixi install or should it still lock on those in your opinion?

  4. adrinjalali commented on Dec 3, 2024

    @adrinjalali
    Author

    I'd like to have a setting which would only touch my lock file if I explicitly tell it to, otherwise I'd like it to be such that no command has a side effect of changing the lock file. I can then have a bot or manually update the lock file at desired intervals.

  5. adrinjalali commented on Dec 4, 2024

    @adrinjalali
    Author

    As an example of why this is needed: sklearn-compat/sklearn-compat#15

    That PR should have been very few lines of diff, and the pixi version in the GH action shouldn't have needed updating. But since I use a newer pixi, the lock file was massively updated, and I had to update the version in the GH action at the same time. That makes very irrelevant changes to that PR.

  6. ruben-arts commented on Dec 6, 2024

    @ruben-arts
    Contributor

    I found some more issues with the workflow you are using, we're looking into how we can make pixi more workable with this use case. There is a conversation about the lockfile going on internally, we've not found a good solution yet, but we'll share some ideas soon.

    One of the biggest problems with your workflow and pixi is that fact that we depend on the pyproject.toml to validate the lockfile which can change if you make a rc release often without really requiring a rebuild for the code.

    More info about this later!

  7. adrinjalali commented on Oct 2, 2025

    @adrinjalali
    Author

    @ruben-arts this feels quite odd and not a good experience to have all my open issues just closed as not planned w/o any information as really why. The closed issues are covering quite a few different areas and it seems you're simply closing doors to reports alltogether?

    cc @wolfv

  8. ruben-arts commented on Oct 2, 2025

    @ruben-arts
    Contributor

    @ruben-arts this feels quite odd and not a good experience to have all my open issues just closed as not planned w/o any information as really why. The closed issues are covering quite a few different areas and it seems you're simply closing doors to reports alltogether?

    cc @wolfv

    I'm sorry. This was an issue with our issue tracking tool Linear, it has suddenly closed all issues that it noted as stale because it was 6mo old. We're working on figuring out what was incorrectly closed.

  9. ruben-arts commented on Oct 2, 2025

    @ruben-arts
    Contributor

    That said, this issue might become obsolete with the proposal in #4457.

    Do you agree?

  10. adrinjalali commented on Oct 6, 2025

    @adrinjalali
    Author

    IIUC, that one avoids having a lockfile alltogether, here I'm asking for only updating the file when I explicitly want to.

  11. ogrisel commented on Jun 16, 2026

    @ogrisel

    @ruben-arts would you consider reopening this feature request? We recently considered using pixi to manage the lock files and environments of our CI for the scikit-learn project (scikit-learn/scikit-learn#34212) and this missing configuration options is a blocker for adopting pixi.

  12. wolfv commented on Jun 16, 2026

    @wolfv
    Member

    @ogrisel sure! we can reopen - maybe you guys can flesh out a little bit what the usage should be like here?

  13. reopened this on Jun 16, 2026
  14. adrinjalali commented on Jun 16, 2026

    @adrinjalali
    Author

    We'd like to be able to set the option on pyproject.toml, so that when contributors work with the project, and whatever pixi command they run (except very explicit commands which would point to updating the lock file), the lock file should stay frozen.

    We have a workflow where once a week a bot would update the lock file for us and automatically open a PR with the updated lock file; ideally the bot would update the lock file in sections, so that each bot PR tackles a section of the CI, but that's another story.

    So the minimal feature here would be to be able to expose the same feature as --frozen via the pyproject.toml config.

  15. wolfv commented on Jun 16, 2026

    @wolfv
    Member

    This is more or less the behavior currently, except when the user changes the pixi.toml dependencies. It would be quite obvious if someone commits a change to the lockfile (or a change to the pixi.toml which would fail the --locked check in CI).

    Did you notice problems with the current pixi or is this more a precautionary measure? :)

  16. ogrisel commented on Jun 16, 2026

    @ogrisel

    Did you notice problems with the current pixi or is this more a precautionary measure? :)

    Actually, I have not tried to use pixi recently because I did not know that the default behavior had changed and I thought we would still need that option for scikit-learn. Maybe the new behavior is indeed compatible with our workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions