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
{{ message }}
Repository navigation
poetry add git+https:// will fail with CalledProcessError if package name includes illegal file name characters #3392
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
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?
python itself has no issue installing
@tanj You mean pip? Or do you mean python setup.py install?
The name of the distribution. The name field is the primary identifier for a distribution. A valid name consists only of ASCII letters and numbers, period, underscore and hyphen. It must start and end with a letter or number. Distribution names are limited to those which match the following regex (run with re.IGNORECASE):
@uda But there are no illegal characters in the name of the project you are trying to install, are there? Maybe you would need to add your voice to a different ticket. Maybe this one: #3366, or just simply correct your pyproject.toml to read branch = 'main', since it seems to be your actual issue.
@tanj You mean pip? Or do you mean python setup.py install?
python setup.py install
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.
@tanj You mean pip? Or do you mean python setup.py install?
python setup.py install
OK, thanks for the confirmation.
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.
No worries, it is a labyrinth... :D
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.
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 :).
@uda [...] or just simply correct your pyproject.toml to read branch = 'main', since it seems to be your actual issue.
To use poetry add, just like pip the branch can be specified with @branch-name at the end: poetry add git+https://github.com/someone/project.git@main.
pipx 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 <<EOFset -xepython -m pip install -q git+https://github.com/python-poetry/poetry.git@refs/pull/5428/headpoetry new foobarpushd foobarpoetry add git+https://github.com/tanj/swissarmy.git#7e671142565cb2b2aa04292ec0775c024bf47547ls \$(poetry env info -p)/srcEOF
Activity
sinoroc commentedon Nov 20, 2020
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
python setup.py install?sinoroc commentedon Nov 20, 2020
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:
uda commentedon Nov 20, 2020
sinoroc commentedon Nov 20, 2020
@uda But there are no illegal characters in the name of the project you are trying to install, are there? Maybe you would need to add your voice to a different ticket. Maybe this one: #3366, or just simply correct your
pyproject.tomlto readbranch = 'main', since it seems to be your actual issue.uda commentedon Nov 20, 2020
Oy, thanks @singulared , I didn't even realize that that's the issue...
tanj commentedon Nov 20, 2020
python setup.py installIt 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.
sinoroc commentedon Nov 20, 2020
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
:).royerk commentedon Sep 9, 2021
To use
poetry add, just like pip the branch can be specified with@branch-nameat the end:poetry add git+https://github.com/someone/project.git@main.abn commentedon Apr 9, 2022
Can you please try the fix at #5428.
Using pipx
Using a container (podman | docker)
abn commentedon May 2, 2022
Resolved-by: #5428
github-actions commentedon Mar 1, 2024
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.