Skip to content

Twine 3.8 - missing install requirement #894

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

Closed
craig-reahl opened this issue Apr 22, 2022 · 15 comments
Closed

Twine 3.8 - missing install requirement #894

craig-reahl opened this issue Apr 22, 2022 · 15 comments

Comments

@craig-reahl
Copy link

Environment

  1. Operating system:
    Ubuntu 20.04

  2. Version of python:
    3.8

  3. Twine installed method
    pip install twine

  4. Version of twine:
    twine-3.8.0-py3-none-any.whl

  5. Target repository for twine to upload to?
    pypi

The Issue

The "twine upload" command breaks with stacktrace:

 Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.12/x64/bin/twine", line 5, in <module>
    from twine.__main__ import main
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/twine/__main__.py", line 22, in <module>
    from twine import cli
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/twine/cli.py", line 18, in <module>
    from packaging import requirements
ModuleNotFoundError: No module named 'packaging'

Workaround

install the "packaging" package manually: pip install packaging

Proposed fix:

Add "packing" to install_requires section in https://github.com/pypa/twine/blob/main/setup.cfg

Steps to Reproduce

create a new python virtualenv without installing any packages except twine
It seems that if you install tox, tox installs the missing package twine itself requires(packaging). So not installing tox in an environment and only installing twine, reproduces the error:
pip install twine

twine upload --skip-existing -r pypi sample-1.0.0-py3-none-any.whl sample-1.0.0-py3-none-any.whl.asc

This command will break and indicated above.

@bhrutledge
Copy link
Contributor

bhrutledge commented Apr 22, 2022

Weird. I get the same error after running pip install twine==3.8.0 in a fresh virtual environment, and the requirement is clearly missing, but Twine 3.8.0 has been available since February 2022, and I think this is the first we're hearing of this issue. I wonder if packaging was being installed as transitive dependency of a direct dependency that's been recently updated to no longer require packaging.

That said, this has been fixed in Twine 4.0.0, specifically c506b22, which removed the packaging import. Can you pip install -U twine?

@craig-reahl craig-reahl changed the title Twine - missing install requirement Twine 3.8 - missing install requirement Apr 22, 2022
@craig-reahl
Copy link
Author

Yes, thanks @bhrutledge , the upgrade to 4.0.0 does solve the issue.

I'm happy if you want to close this issue.

@merwok
Copy link

merwok commented Jun 12, 2023

What? Your issue, this ticket and the linked ticket are three different things.

@merwok
Copy link

merwok commented Jun 12, 2023

«Stack» is a very generic programming term. The website you are referring to is called Stack Overflow, or short SO. Nobody calls it stack.

This is the Twine repo on Github, it has no relation with Stack Overflow. Complaining about another site’s policies is fruitless.
Reopening unrelated bugs will not get you help.

jmahlik added a commit to StateFarmIns/sagemaker-python-sdk that referenced this issue Apr 22, 2024
Twine 3.8.0 didn't include its dependencies. The tox stage happened to
work from packaging being installed as a transitive.

Ref: pypa/twine#894
jmahlik added a commit to StateFarmIns/sagemaker-python-sdk that referenced this issue Apr 22, 2024
Twine 3.8.0 didn't include its dependencies. The tox stage happened to
work from packaging being installed as a transitive.

Ref: pypa/twine#894
jmahlik added a commit to StateFarmIns/sagemaker-python-sdk that referenced this issue Apr 22, 2024
Twine 3.8.0 didn't include its dependencies. The tox stage happened to
work from packaging being installed as a transitive.

Ref: pypa/twine#894
liujiaorr pushed a commit to aws/sagemaker-python-sdk that referenced this issue Apr 22, 2024
* change: adjust tox black stages to install from requirements file

Also remove uneeded config in the command, it is now set in the pyproject.toml
so IDE's and other tooling outside tox picks up the setting.

* change: improve tox install times by not installing all deps when not needed

Moved to using deps to override the test extra being installed in
skip_install tox stages. Now only the needed deps are installed.

Improves install time by around 7x.

Closes #4591

* change: bump twine version to 5.0.0

Twine 3.8.0 didn't include its dependencies. The tox stage happened to
work from packaging being installed as a transitive.

Ref: pypa/twine#894
jiapinw pushed a commit to jiapinw/sagemaker-python-sdk that referenced this issue Jun 25, 2024
* change: adjust tox black stages to install from requirements file

Also remove uneeded config in the command, it is now set in the pyproject.toml
so IDE's and other tooling outside tox picks up the setting.

* change: improve tox install times by not installing all deps when not needed

Moved to using deps to override the test extra being installed in
skip_install tox stages. Now only the needed deps are installed.

Improves install time by around 7x.

Closes aws#4591

* change: bump twine version to 5.0.0

Twine 3.8.0 didn't include its dependencies. The tox stage happened to
work from packaging being installed as a transitive.

Ref: pypa/twine#894
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@merwok @bhrutledge @craig-reahl and others