question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Making spec the argument of install

See original GitHub issue

In https://github.com/pipxproject/pipx/issues/144, @raxod502 mentioned

I am quite confused why the package name I give pipx wouldn’t normally be passed to pip install. I don’t see any explanation of what the alternative is.

Why do we separately specify the package name and the requirement-specifier? For example, the API I wonder about is just copying pip’s interface:

$ pip install --help  

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

The advantages are:

  • A distribution name can be specified, or a url or a path.
  • Any number of requirements can be specified.
  • I don’t have to learn a new syntax, I can just use pip’s which I already know.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:24 (16 by maintainers)

github_iconTop GitHub Comments

3reactions
itsayellowcommented, Dec 6, 2019

And this can be faster than a regular install of the package, because it works by installing using the --no-dependencies option to pip. So for package name determination you would only wait just for the main package to install and not for any of its dependencies to install.

3reactions
raxod502commented, Dec 4, 2019

duplicating pip’s interface would mean pipx needs to create two venvs and throw one away just to discover the package name

Ok, but consider this: somebody is going to have to discover the package name. No reasonable user is going to realize to begin with that the package name is different from the Git repo name. So what’s going to happen is they will try to install it with pipx, hit this error, try using the Git repo as the package name after finding this issue, get another error when the package name doesn’t match, and then install a second time with the correct package name that they eventually figure out from looking on GitHub most likely. You still end up with two virtualenvs that were created, and it’s a heck of a lot slower because it’s the user doing the troubleshooting, instead of pipx. Why don’t we assume that the package name is the same as the Git repo, with a slower fallback, as part of the effort to discourage package authors from making poor packaging decisions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Making spec the argument of install · Issue #147 · pypa/pipx
I believe it is because pipx needs to make a virtualenv based on the package name, which is not always clear from the...
Read more >
Using Spec Files — PyInstaller 5.7.0 documentation
In the spec file, make a list of tuples that describe the files needed. Assign the list of tuples to the binaries= argument...
Read more >
pip install - pip documentation v22.3.1
Argument Handling# ... When looking at the items to be installed, pip checks what type of item each is, in the following order:...
Read more >
SPEC CPU®2017 Frequently Asked Questions
05 Why does installation fail on macOS with messages claiming that the software "cannot be opened because the developer cannot be verified"?
Read more >
Passing user defined argument to RPM is possible while ...
Now when you install the RPM, you can specify a different prefix. rpm -i sample.rpm --prefix /tmp. This will install the file in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found