-
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 1.2.0a1: AttributeError when installing package from secondary repo #4085
Comments
If I delete
|
We are seeing the same issue with one of our projects using |
I saw the same issue, if I manually add the sha256 hash to poetry.lock it appears to work. I'm not sure why, but the one package I'm trying to install from a secondary repo is the only one in poetry.lock to have an md5sum instead. |
This replaces the AttributeError reported in python-poetry#4085 with the proper exception.
This replaces the AttributeError reported in python-poetry#4085 with the proper exception.
This replaces the AttributeError reported in python-poetry#4085 with the proper exception.
I've opened a PR to generate this error message properly: #4212. I'm experiencing the underlying issue in Poetry 1.2.0a1. I'm installing a package from a private Gemfury repository. Gemfury's legacy PyPI API returns only md5 hashes, not sha256 hashes. (By comparison, JFrog had a similar limitation until recently.) My lockfile contains only sha256 hashes, hence the mismatch error at install time. In contrast, Poetry 1.1.7 works fine. A lockfile generated by 1.1.7 also contains the sha256 hashes, yet installation works fine. Is it possible this is a regression caused by the changes in #2958? |
We're seeing the same issue with a private Nexus Repository repository. Switching to 1.1.7 resolves the issue. $ poetry add private-package
Using version ^1.2.3 for private-package
Updating dependencies
Resolving dependencies... (0.5s)
Package operations: 1 install, 0 updates, 0 removals
• Installing private-package (2.2.1): Failed
RuntimeError
Retrieved digest for link private-package-1.2.3.tar.gz(md5:670c37d9f05bed7839ea066449506deb) not in poetry.lock metadata ['sha256:3bd4e2a33293ff39aaaa91db332b2dd4c0c7700e1e006c9503fd5d83b36c05a1', 'sha256:6aa65bf07a9cfe59dab158b6b20a5e3aa8042b16ca7a9812d2bdcdf37e3a486a']
at ~/Library/Caches/pypoetry/virtualenvs/project-KWD0UkE9-py3.9/lib/python3.9/site-packages/poetry/installation/chooser.py:110 in _get_links
106│
107│ selected_links.append(link)
108│
109│ if links and not selected_links:
→ 110│ raise RuntimeError(
111│ f"Retrieved digest for link {link.filename}({h}) not in poetry.lock metadata {hashes}"
112│ )
113│
114│ return selected_links
Failed to add packages, reverting the pyproject.toml file to its original content. |
Seeing a similar issue with
Running
Note there are no dependencies in the
|
I just started seeing this |
@paulmelnikow Thanks. Would like me to create a separate issue then? I thought this issue was similar and just didn't want to create a duplicate. |
I'm not a maintainer, but I've been meaning to report the "can't set attribute" error and do think it belongs in its own issue. |
Oh sorry for the confusion. I'll extract it as a separate issue and link this as a related issue. |
I ran across this, and the root is that my package provided only a "md5" hash, not a "sha256" one, resulting in a hash verification error. I have a patched setup that fixes this, working on a set of PRs to address it. |
Having the same issue on poetry 1.1.9. One of the packages uses md5 hash. Switching to sha256 in lockfile does not help
|
This regression appeared in Poetry 1.1.7/1.1.9 two days ago when poetry-core 1.0.5 was released. Downgrading to poetry-core 1.0.4 is a workaround. |
@paulmelnikow how to do that? |
I confirm, all our internal package installs are broken since today, pinning |
I had the same issue, pinning Is there a fix in progress, or does an issue need to be logged to |
I was using Poetry 1.1.6 and it was working fine probably with poetry-core 1.0.4. Now that poetry-core got updated to 1.0.5, I started getting same errors on Poetry 1.1.6. So, poetry-core is getting updated independently of Poetry version perhaps. |
'Link' object has no attribute 'name' at /usr/local/lib/python3.9/site-packages/poetry/installation/executor.py:620 in _download_link
|
Just to add my 2 cents. I have poetry 1.1.6, and if you re-install it, it will go to poetry-core 1.0.5 which has this defect. This in my opinion should not be the case. Also, how can we go about and get poetry-core fixed ? |
I've got the same issue when installing torch 1.10.0.
It does work with torch 1.7.1. (Sorry, bit arbitrary version comparison, but I found out about this on accident and I want to leave the info here for others that have similar problems). |
I was (finally!) able to solve this for torch 1.10.0. I removed poetry completely (using For reference: these PR and SO post helped me. Bash commands I executed to uninstall poetry completely: python3 get-poetry.py --uninstall
POETRY_UNINSTALL=1 python3 get-poetry.py
pip3 uninstall poetry
rm -r .local/share/pypoetry
rm .cache/pypoetry -r
rm .local/bin/poetry |
I get the same issue too with 1.2.0a2 if I install via the new install_poetry.py script. If I install poetry into a venv with
And I do not use a secondary repo at all. |
les versions supérieures poetry ne réussisent pas à récupérer des modules sur nexus https://stackoverflow.com/questions/69836936/poetry-attributeerror-link-object-has-no-attribute-name python-poetry/poetry#4085
For what it's worth, the hash issue listed below from a failed docker build has been resolved as of Poetry The issue was known to break our builds using Poetry
|
This was fixed in #4531, I reckon |
Agreed, I cannot reproduce on current master. Please request a re-open if this is still affecting you. |
I use a secondary repo and I'm having this issue with 1.2.0:
reverting back to 1.1.15 solved the issue. |
@neersighted same issue on poetry 1.2.0 with packages from a local nexus. Can you reopen it? |
This issue describes an attribute error in code that no longer exists, closed is definitely the right state for it. You want #6301 maybe |
Same issue on every version I tried after 1.1.15
|
Please refer to #6301 instead of commenting on resolved issues. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: macOS 10.15
Poetry version: 1.2.0a1
Link of a Gist with the contents of your pyproject.toml file:
Issue
Hi! I'm testing new 1.2.0a1 version as an early-adopter to find potential issues.
My
pyproject.toml
defines a secondary repo:And I have one dependency which comes from this private pypi repo. Poetry 1.1.3 installed it without errors, but on 1.2.0a1 I get this stacktrace:
If you need any additional info to better understand the issue, I'll be happy to provide it.
The text was updated successfully, but these errors were encountered: