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.

[feature] Support pipx run with different name in entry point natively if a package wants to support it

See original GitHub issue

How would this feature be useful?

Currently, running pipx run build does not work; it requires pipx run --spec build pyproject-build. It would not be safe to add a build script entry point to pypa/build, due to how common that name would be. It would be nice to have a way for a package to tell pipx run “here’s my entry point, use this”. I know the author of pypa/build (@FFY00) was interested in supporting pipx (and pipx run build would be fantastic, imo). This affects projects with a common or unsafe name for an entry point.

Describe the solution you’d like These are some initial ideas:

  1. If a matching console entry point is not found, pipx run could fall back on python -m <name> if <name>/__main__.py is present.
  2. There could be a pipx entry point in a package. Say "pipx.run.<name>". If this was specified, then that would be used by run. (I’m not very familiar with non-console entry points, but I think this is a valid way to use them)
  3. Have a dict in pipx for common packages. (probably not a good idea? If #596 went through, then one could argue that build, also being in the PyPA, would be a valid candidate for special treatment. This doesn’t solve the issue generally, though)

These ideas would allow a package that supports pipx to have a dependency that supports pipx and not trip up the discovery.

Describe alternatives you’ve considered

This potentially would be a useful alternative to https://github.com/pipxproject/pipx/issues/177. I really like the idea of pipx run -m, as it would let me do things like pipx run -m rich, since rich so far has resisted adding an entry point and is python -m rich.<stuff> only.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
henryiiicommented, Apr 12, 2021

This was completed in #615 and released in 0.16, and is now even available on all the GitHub Actions runners! 😃

2reactions
uranusjrcommented, Jan 20, 2021

Makes sense. I may find some time to implement this and see how it works in practice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[feature] Support pipx run with different name in entry point ...
There could be a pipx entry point in a package. Say "pipx.run.<name>" . If this was specified, then that would be used by...
Read more >
Docs - pipx
execute binaries from Python packages in isolated environments.
Read more >
Pipx: install and Run Python Applications In Isolated ... - Morioh
Pipx : Install and Run Python Applications in Isolated Environments. pipx is a tool to help you install and run end-user applications written...
Read more >
why do I keep getting this message when installing saying ...
has a - in it, I'm not sure if that's supported ( git-maildiff is not a ... git-maildiff as the entry-point name and...
Read more >
pipenv Documentation - Read the Docs
Pipx is a tool to help you install and run end-user applications written in ... If one does exist, it will automatically be...
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