You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created some CLI tools for myself a while back where I defined the command I'll invoke as , or something prefixed with a , such as ,docker to make it easier to find the when tab completing(Idea I got from one of Brandon Rhodes' talks). Since I make updates often and want it to be available globally, I installed my package as I use pipx I installed my package with pipx install --editable . and it always worked and got used it.
I recently noticed that if I install the package without the --editable flag it now fails with the following error
TypeError: expected str, bytes or os.PathLike object, not NoneType
Documentation mentionsname may contain any characters except =, but it cannot start or end with any whitespace character, or start with [. which suggest , should be valid.
The name may contain any characters except =, but it cannot start or end with any whitespace character, or start with [. For new entry points, it is recommended to use only letters, numbers, underscores, dots and dashes (regex [\w.-]+).
Expected behavior
Comma should be capture in the ENTRY_RE regex name capture group to allow for , to become a valid command.
pip version
23.0.1
Python version
3.11
OS
Mac
How to Reproduce
git clone https://github.com/FlavioAmurrioCS/commabug.git /tmp/comma
virtuealenv /tmp/venv
/tmp/venv/bin/pip install /tmp/comma/ # Will show error
@vsajip What is the process for this change to make it to the latest pip? I saw in the other conversation(pypa/pip#12151) that this fix was part of distlib 0.3.7 but have yet to see the fix propagate to pip.
I see you've asked on the pip issue tracker too. The releases of pip are entirely up to them. They apparently plan to do a release this month, but from what I can see they're still using distlib 0.3.6.
Description
I created some CLI tools for myself a while back where I defined the command I'll invoke as
,
or something prefixed with a,
such as,docker
to make it easier to find the when tab completing(Idea I got from one of Brandon Rhodes' talks). Since I make updates often and want it to be available globally, I installed my package as I use pipx I installed my package withpipx install --editable .
and it always worked and got used it.I recently noticed that if I install the package without the
--editable
flag it now fails with the following errorDoing some digging around I found the following:
When installing normally (ie :
pip install package
) which uses a regex and capture groups to parse the console_script specification. Since,
is not part of the capture group name is now None and therefore causing the error above when getting toScriptMaker._make_script
. For the,docker
command it now becomesdocker
since the , was not captured.https://github.com/pypa/pip/blob/b252ad819bc7b998508a7ed8789b60dceddfd603/src/pip/_vendor/distlib/util.py#L710-L743
When installing as editable(ie :
pip install --editable package
), the following snippet is in charge parsing the console_scriptshttps://github.com/pypa/pip/blob/b252ad819bc7b998508a7ed8789b60dceddfd603/src/pip/_internal/metadata/pkg_resources.py#L185-L189
Example Entry Point
Documentation mentions
name may contain any characters except =, but it cannot start or end with any whitespace character, or start with [.
which suggest,
should be valid.Expected behavior
Comma should be capture in the ENTRY_RE regex name capture group to allow for
,
to become a valid command.pip version
23.0.1
Python version
3.11
OS
Mac
How to Reproduce
git clone https://github.com/FlavioAmurrioCS/commabug.git /tmp/comma virtuealenv /tmp/venv /tmp/venv/bin/pip install /tmp/comma/ # Will show error
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: