Skip to content

The combination of --no-install and --pypi options leads to an error #817

Closed

Description

@olivier-lacroix

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

mkdir /tmp/fcdnzjakle
cd /tmp/fcdnzjakle
pixi init
pixi add python
pixi add --no-install --pypi pandas

Issue description

The combination of --no-install and --pypi options leads to a failure with

Cannot update pypi dependencies without first installing a conda prefix that includes python.

Expected behavior

No error if python has been installed previously in the project

Activity

  1. added
    bug
    on Feb 17, 2024
  2. ruben-arts commented on Feb 17, 2024

    @ruben-arts
    Contributor

    I think this is an easier change now as the conda and pypi resolve are less coupled in the last release.

    Will get back to this.

  3. olivier-lacroix commented on Feb 17, 2024

    @olivier-lacroix
    ContributorAuthor

    Thanks @ruben-arts !

    FYI, I stumbled upon this issue when trying to add pixi in the uv benchmark scripts. I did my best based on my understanding of pixi, but feel free to propose changes there to ensure it is a fair comparison :-)

  4. ruben-arts commented on Feb 17, 2024

    @ruben-arts
    Contributor

    Thank you @olivier-lacroix, we'll definitely take a look at that!

  5. tdejager commented on Feb 17, 2024

    @tdejager
    Contributor

    Maybe we should add the packaging ecosystem as an argument for --no-install seeing as you do want to install pypi for the benchmark.

    Btw to astral.sh we have been keeping a close eye on the uv release, congrats 🎉! Great work! 😄

    And @olivier-lacroix thanks for taking the time to update the benchmark :) let's get it to work!

  6. olivier-lacroix commented on Feb 18, 2024

    @olivier-lacroix
    ContributorAuthor

    @tdejager , in the benchmark, I am actually trying to only add the pypi packages to the lockfile without installing them, by installing adding python first, then adding the pypi packages with the --no-install flag.

    I am not even sure having python installed should be needed for a --no-install: wouldn't having python in the lockfile be sufficient?

  7. tdejager commented on Feb 18, 2024

    @tdejager
    Contributor

    Because we don't depend on a system python for pixi. We want to be completely stand-alone and this also makes it possible to use one project (pixi.toml) for multiple python versions.

    We need a python version for building source distributions, we could make seperate behavior to only allow wheels though. Note, that you need an interpreter even though you are not installing the files, because you need to 'build' the package metadata as well.

  8. olivier-lacroix commented on Feb 18, 2024

    @olivier-lacroix
    ContributorAuthor

    @tdejager for building source distribution I agree. But in case we 'only' want to generate the lockfile, that should not be required, right (as long as we know the python version)? Which is what the --no-install does if my understanding is correct?

    EDIT: saw your edits, and understand that python is still required even to just create the lockfile...

  9. wolfv commented on Feb 18, 2024

    @wolfv
    Member

    @olivier-lacroix for the purpose of benchmarking, you could build rip using cargo and then run the included binary. E.g.

    cargo b --release
    $ ./target/release/rip --help                                                                                                                                                                                                                                           
    Binary to verify and play around with rattler_installs_packages
    
    Usage: rip [OPTIONS] <COMMAND>
    
    Commands:
      wheels   Options w.r.t locally built wheels
      resolve  Resolve a set of requirements and output the resolved versions
      install  Resolve and install a set of requirements
      help     Print this message or the help of the given subcommand(s)
    
    Options:
      -v, --verbose...             Increase logging verbosity
      -q, --quiet...               Decrease logging verbosity
          --index-url <INDEX_URL>  Base URL of the Python Package Index (default <https://pypi.org/simple>). This should point to a repository compliant with PEP 503 (the simple repository API) [default: https://pypi.org/simple/]
      -h, --help                   Print help
      -V, --version                Print version

    You could use the resolve option to only resolve some binaries. This will find the system Python interpreter.

  10. ruben-arts commented on Feb 29, 2024

    @ruben-arts
    Contributor

    Closing this issue as the reason for this issue is not required anymore.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions