-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
poetry add git+https:// will fail with CalledProcessError if package name includes illegal file name characters #3392
Comments
My first impression, is that I do not think it is fair to classify this as a bug in poetry. But... One would need to check exactly what the standard (if any) says for such a case. Maybe indeed poetry is supposed to apply some name normalization somewhere and it does not currently... @tanj Have you managed to identify the corresponding text of a standard for project names? What is allowed and what is not? Should poetry do some name normalization or should it reject such a project from installation?
@tanj You mean pip? Or do you mean |
The best I could find in a short time is:
-- https://packaging.python.org/specifications/core-metadata/#name See also: https://www.python.org/dev/peps/pep-0508/#names And indeed:
|
This comment has been minimized.
This comment has been minimized.
Oy, thanks @singulared , I didn't even realize that that's the issue... |
It appears that when installing in that way setuptools strips the offending characters. I did go looking briefly before posting this bug report but didn't find PEP508 or the page you found. Maybe I should report this to setuptools? I would think a warning should be issued if they are modifying the package name to fit PEP508. |
OK, thanks for the confirmation.
No worries, it is a labyrinth... :D
I guess, it is worth asking them the question. Yes a warning sounds good to me. [I do not know if it can be considered a bug at this point. setuptools (and distutils before that) are so old now, that by now it must be considered a feature for some of their users. And removing this "feature" from setuptools would only cause trouble. :D ] Maybe poetry as well could be more careful here. I do not know if it is possible to check the metadata before creating the directory (with a name containing a |
To use |
Can you please try the fix at #5428. Using pipxpipx install --suffix=@5428 'poetry @ git+https://github.com/python-poetry/poetry.git@refs/pull/5428/head'
poetry@5428 new foobar
cd foobar
poetry@5428 add git+https://github.com/tanj/swissarmy.git#7e671142565cb2b2aa04292ec0775c024bf47547
ls $(poetry env info -p)/src Using a container (podman | docker)podman run --rm -i --entrypoint bash docker.io/python:3.10 <<EOF
set -xe
python -m pip install -q git+https://github.com/python-poetry/poetry.git@refs/pull/5428/head
poetry new foobar
pushd foobar
poetry add git+https://github.com/tanj/swissarmy.git#7e671142565cb2b2aa04292ec0775c024bf47547
ls \$(poetry env info -p)/src
EOF + poetry add git+https://github.com/tanj/swissarmy.git#7e671142565cb2b2aa04292ec0775c024bf47547
Creating virtualenv foobar-lWDpn5M1-py3.10 in /root/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...
Writing lock file
Package operations: 3 installs, 0 updates, 0 removals
• Installing six (1.16.0)
• Installing python-dateutil (2.8.2)
• Installing swiss army: untility package (0.1 7e67114)
++ poetry env info -p
+ ls /root/.cache/pypoetry/virtualenvs/foobar-lWDpn5M1-py3.10/src
swissarmy |
Resolved-by: #5428 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option).Issue
I was starting a new project and adding some dependencies and came across a bug in the git clone process.
The issue is that my swissarmy package has a
:
in the package name and that is an illegal character for a windows file path.The offending code is located at
poetry/poetry/installation/executor.py
Line 562 in 639d5e0
I realize that naming my package like that probably is breaking some PEP, but python itself has no issue installing and using the package...
pip freeze output for that package
-e git+https://github.com/tanj/swissarmy.git@7e671142565cb2b2aa04292ec0775c024bf47547#egg=Swiss_Army_Untility_Package
The text was updated successfully, but these errors were encountered: