Closed Lothiraldan closed 2 years ago
Hm. I'm not able to reproduce that error. I cloned https://github.com/buildbot/hello-world and made the same change to setup.py
.
% twine --version
twine version 3.7.1 (importlib_metadata: 4.9.0, pkginfo: 1.8.2, requests: 2.26.0, requests-toolbelt: 0.9.1, tqdm: 4.62.3)
% python3 -m build
...
Successfully built hello_world-1.0.0.tar.gz and hello_world-1.0.0-py3-none-any.whl
% twine upload -r testpypi dist/*
...
Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more information.
I am able to reproduce it if I downgrade pkginfo:
% pip install 'pkginfo<1.8'
...
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
twine 3.7.1 requires pkginfo>=1.8.1, but you have pkginfo 1.7.1 which is incompatible.
Successfully installed pkginfo-1.7.1
% twine --version
twine version 3.7.1 (importlib_metadata: 4.9.0, pkginfo: 1.7.1, requests: 2.26.0, requests-toolbelt: 0.9.1, tqdm: 4.62.3)
% twine upload -r testpypi dist/*
...
AttributeError: 'Wheel' object has no attribute 'dynamic'
Are you sure you were using pkginfo==1.8.2
when you got the traceback? It looks like Twine was executing from a global conda environment, which makes me wonder what else is installed in that environment, and if pkginfo was somehow out of sync with Twine.
Did you try running Twine from its own virtual environment? pipx is a great way to do that.
Hi @bhrutledge, I think you are right. I have opened a bug too early, I had an older version of pkginfo installed in the conda environment that somehow was loaded instead of the up-to-date pkginfo that I installed with pip. Feel free to close this issue and sorry about the noise again.
@bhrutledge I have a similar issue but pkginfo is up to date.
twine --version
>
twine version 3.7.1 (importlib_metadata: 4.8.2, pkginfo: 1.8.2, requests:
2.26.0, requests-toolbelt: 0.9.1, tqdm: 4.62.3)
GHA logs: https://github.com/pytorch/ignite/runs/4589104222?check_suite_focus=true#step:7:413
However I can not reproduce the issue locally neither. Any hints on how to fix the problem ? Thanks
EDIT: looks like it is again pkginfo version issue. conda package related steps reinstall pkginfo==1.7.2 (don't know why) but twine reports newer versions and certainly uses older ones...
@vfdev-5 From that workflow run, it looks like "Build and Publish Conda binaries" is installing pkginfo==1.7.1
after Twine and pkginfo==1.8.2
are installed in "Install dependencies": https://github.com/pytorch/ignite/runs/4589104222?check_suite_focus=true#step:6:269
So, one workaround might be install Twine in "Build and Publish PyPi binaries". Another option might be to skip the pip install twine
and use pipx to isolate its environment, e.g.
pipx run twine check dist/*
pipx run twine upload --verbose dist/*
It does seem odd that Twine is reporting 1.8.2 (via importlib_metadata.version) but apparently importing 1.7.1. @jaraco Any insight?
Your Environment
Thank you for taking the time to report an issue.
To more efficiently resolve this issue, we'd like to know some basic information about your system and setup.
1) Your operating system: Linux / Docker
2) Version of python you are running:
3) How did you install twine? Did you use your operating system's package manager or pip or something else?
I Used pip
4) Version of twine you have installed (include complete output of):
5) Which package repository are you targeting?
Test Pypi. I got the issue with an internal package but I could reproduce with https://github.com/buildbot/hello-world/blob/master/setup.py after applying the following diff:
If you're having issues uploading a specific package, you must include a copy of the following:
PKG-INFO
file.pypirc
file (REMOVE ALL USERNAMES & PASSWORDS BEFORE UPLOADING)The Issue
When trying to upload a wheel file, I get the following traceback:
When trying to upload a tar.gz file, I get the following traceback:
After downgrading
plginfo
to 1.8.1, the upload seems to works with the exact same files (I don't have permission to this project on TestPypi so I'm getting the expected 403):Steps to Reproduce
pkginfo
version 1.8.2 installed.