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

Normalise entry point and package name to make 'pip run' more permissive #618

Open
uranusjr opened this issue Feb 1, 2021 · 3 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@uranusjr
Copy link
Member

uranusjr commented Feb 1, 2021

Continuing the discussion in #615 (comment)

I'm assuming the following will not work:

pipx run bUiLd --help

It will download and install build properly from PyPI (I believe) but it won't match the likely pipx.run endpoint name of "build".

console scripts in conjunction with pipx run would face the same issue.

How can we improve this? I guess it’s not too controversial that the names should be case-insensitive. How about dashes, underscores, and dots? Do we use the same normalisation logic as PEP 503?

This change would also make the check here more difficult:

https://github.com/pipxproject/pipx/blob/25a227b2092f672c88622209d99953a758502f18/src/pipx/commands/run.py#L59-L69

Since now we will need to walk through PATH and make sure none of the variants exist on it?

@henryiii
Copy link
Contributor

henryiii commented Mar 3, 2021

@itsayellow
Copy link
Contributor

Yeah maybe. There seems to be a policy difference between python package names which are permissive and python console script names which seem to want to be case sensitive.

@uranusjr
Copy link
Member Author

uranusjr commented Mar 3, 2021

Pip uses distlib (most of the time) to look up entrypoints, and pipx.run uses importlib.metadata, both preserves case IIUC.

The only scenario I can think of the setuptools would cause a behavioural change (for pipx) is for packages that only distribute source dists and cannot be built as a wheel, in which case the entry points will be created by setuptools (via setup.py install).

@gaborbernat gaborbernat added enhancement New feature or request help wanted Extra attention is needed labels Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants