Skip to content
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

typing_extensions module not found error #100

Closed
wichert opened this issue Jul 11, 2022 · 2 comments
Closed

typing_extensions module not found error #100

wichert opened this issue Jul 11, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@wichert
Copy link

wichert commented Jul 11, 2022

I have a GitHub workflow which automatically publishes a package to an internal repository. This started failing suddenly:

Traceback (most recent call last):
  File "/usr/local/bin/twine", line 5, in <module>
    from twine.__main__ import main
  File "/usr/local/lib/python3.9/site-packages/twine/__main__.py", line 22, in <module>
    from twine import cli
  File "/usr/local/lib/python3.9/site-packages/twine/cli.py", line 21, in <module>
    import rich.logging
  File "/usr/local/lib/python3.9/site-packages/rich/logging.py", line 13, in <module>
    from .traceback import Traceback
  File "/usr/local/lib/python3.9/site-packages/rich/traceback.py", line 26, in <module>
    from .syntax import Syntax
  File "/usr/local/lib/python3.9/site-packages/rich/syntax.py", line 52, in <module>
    from typing_extensions import TypeAlias
ModuleNotFoundError: No module named 'typing_extensions'

I suspect this happens as a result of our GitHub Enterprise instance rebuilding the action and picking up a broken version of rich.

Action build log For reference here is the build log for the action:
Download action repository 'synced-actions/pypa-gh-action-pypi-publish@release/v1' (SHA:717ba43cfbb0387f6ce311b169a825772f54d295)
##[group]Build container for action use: '/home/github-runner/runner/_work/_actions/synced-actions/pypa-gh-action-pypi-publish/release/v1/Dockerfile'.
##[command]/usr/bin/docker build -t 3c1af3:80a6e1411dc34e96865a7a24d3710fde -f "/home/github-runner/runner/_work/_actions/synced-actions/pypa-gh-action-pypi-publish/release/v1/Dockerfile" "/home/github-runner/runner/_work/_actions/synced-actions/pypa-gh-action-pypi-publish/release/v1"
Sending build context to Docker daemon  24.06kB

Step 1/13 : FROM python:3.9-slim
3.9-slim: Pulling from library/python
b85a868b505f: Already exists
e2be974225ed: Already exists
339a4e72a1f5: Already exists
988bab9f4d93: Already exists
1469e6f7b9e6: Already exists
Digest: sha256:c01a2db78654c1923da84aa41b829f6162011e3a75db255c24ea16fa2ad563a0
Status: Downloaded newer image for python:3.9-slim
 ---> 32504e766568
Step 2/13 : LABEL "maintainer" "Sviatoslav Sydorenko <wk+pypa@sydorenko.org.ua>"
 ---> Running in 11b606ca4247
Removing intermediate container 11b606ca4247
 ---> 1a3edab823b3
Step 3/13 : LABEL "repository" "https://github.com/pypa/gh-action-pypi-publish"
 ---> Running in cd64fe5c10f0
Removing intermediate container cd64fe5c10f0
 ---> b21586b3bff0
Step 4/13 : LABEL "homepage" "https://github.com/pypa/gh-action-pypi-publish"
 ---> Running in c23bb58f1b4f
Removing intermediate container c23bb58f1b4f
 ---> c64ee633b8e8
Step 5/13 : ENV PYTHONDONTWRITEBYTECODE 1
 ---> Running in c5cd1752a911
Removing intermediate container c5cd1752a911
 ---> 6da2ea9353dc
Step 6/13 : ENV PYTHONUNBUFFERED 1
 ---> Running in c91359ccdfff
Removing intermediate container c91359ccdfff
 ---> bc3d3f49e991
Step 7/13 : RUN   pip install --upgrade --no-cache-dir pip-with-requires-python &&   pip install --upgrade --no-cache-dir --prefer-binary twine
 ---> Running in ef1b1af1a797
Collecting pip-with-requires-python
  Downloading pip_with_requires_python-1.0.1-py2.py3-none-any.whl (2.3 kB)
Requirement already satisfied: pip>=21 in /usr/local/lib/python3.9/site-packages (from pip-with-requires-python) (22.0.4)
Installing collected packages: pip-with-requires-python
Successfully installed pip-with-requires-python-1.0.1
�[91mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
�[0m�[91mWARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
�[0mCollecting twine
  Downloading twine-4.0.1-py3-none-any.whl (36 kB)
Collecting rich>=12.0.0
  Downloading rich-12.5.0-py3-none-any.whl (235 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 235.7/235.7 KB 34.0 MB/s eta 0:00:00
Collecting pkginfo>=1.8.1
  Downloading pkginfo-1.8.3-py2.py3-none-any.whl (26 kB)
Collecting importlib-metadata>=3.6
  Downloading importlib_metadata-4.12.0-py3-none-any.whl (21 kB)
Collecting readme-renderer>=35.0
  Downloading readme_renderer-35.0-py3-none-any.whl (14 kB)
Collecting requests>=2.20
  Downloading requests-2.28.1-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 KB 4.1 MB/s eta 0:00:00
Collecting urllib3>=1.26.0
  Downloading urllib3-1.26.10-py2.py3-none-any.whl (139 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.2/139.2 KB 241.3 MB/s eta 0:00:00
Collecting rfc3986>=1.4.0
  Downloading rfc3986-2.0.0-py2.py3-none-any.whl (31 kB)
Collecting keyring>=15.1
  Downloading keyring-23.6.0-py3-none-any.whl (34 kB)
Collecting requests-toolbelt!=0.9.0,>=0.8.0
  Downloading requests_toolbelt-0.9.1-py2.py3-none-any.whl (54 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.3/54.3 KB 214.5 MB/s eta 0:00:00
Collecting zipp>=0.5
  Downloading zipp-3.8.0-py3-none-any.whl (5.4 kB)
Collecting SecretStorage>=3.2
  Downloading SecretStorage-3.3.2-py3-none-any.whl (15 kB)
Collecting jeepney>=0.4.2
  Downloading jeepney-0.8.0-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.4/48.4 KB 189.1 MB/s eta 0:00:00
Collecting docutils>=0.13.1
  Downloading docutils-0.19-py3-none-any.whl (570 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 570.5/570.5 KB 63.9 MB/s eta 0:00:00
Collecting Pygments>=2.5.1
  Downloading Pygments-2.12.0-py3-none-any.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 261.6 MB/s eta 0:00:00
Collecting bleach>=2.1.0
  Downloading bleach-5.0.1-py3-none-any.whl (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.9/160.9 KB 235.2 MB/s eta 0:00:00
Collecting charset-normalizer<3,>=2
  Downloading charset_normalizer-2.1.0-py3-none-any.whl (39 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.3-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 KB 227.1 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2022.6.15-py3-none-any.whl (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.2/160.2 KB 256.2 MB/s eta 0:00:00
Collecting commonmark<0.10.0,>=0.9.0
  Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.1/51.1 KB 197.0 MB/s eta 0:00:00
Collecting webencodings
  Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting six>=1.9.0
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting cryptography>=2.0
  Downloading cryptography-37.0.4-cp36-abi3-manylinux_2_24_x86_64.whl (4.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.1/4.1 MB 228.0 MB/s eta 0:00:00
Collecting cffi>=1.12
  Downloading cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 441.2/441.2 KB 256.4 MB/s eta 0:00:00
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 KB 241.5 MB/s eta 0:00:00
Installing collected packages: webencodings, commonmark, zipp, urllib3, six, rfc3986, Pygments, pycparser, pkginfo, jeepney, idna, docutils, charset-normalizer, certifi, rich, requests, importlib-metadata, cffi, bleach, requests-toolbelt, readme-renderer, cryptography, SecretStorage, keyring, twine
Successfully installed Pygments-2.12.0 SecretStorage-3.3.2 bleach-5.0.1 certifi-2022.6.15 cffi-1.15.1 charset-normalizer-2.1.0 commonmark-0.9.1 cryptography-37.0.4 docutils-0.19 idna-3.3 importlib-metadata-4.12.0 jeepney-0.8.0 keyring-23.6.0 pkginfo-1.8.3 pycparser-2.21 readme-renderer-35.0 requests-2.28.1 requests-toolbelt-0.9.1 rfc3986-2.0.0 rich-12.5.0 six-1.16.0 twine-4.0.1 urllib3-1.26.10 webencodings-0.5.1 zipp-3.8.0
�[91mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
�[0m�[91mWARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
�[0mRemoving intermediate container ef1b1af1a797
 ---> 046f2ee26b32
Step 8/13 : WORKDIR /app
 ---> Running in 127cf8ea61c8
Removing intermediate container 127cf8ea61c8
 ---> b0f15fb5cb38
Step 9/13 : COPY LICENSE.md .
 ---> 04fb6c6f5f66
Step 10/13 : COPY twine-upload.sh .
 ---> dfd1be73930a
Step 11/13 : COPY print-hash.py .
 ---> 009bc7c89728
Step 12/13 : RUN chmod +x twine-upload.sh
 ---> Running in c36623a9176a
Removing intermediate container c36623a9176a
 ---> ba70e23a0d1a
Step 13/13 : ENTRYPOINT ["/app/twine-upload.sh"]
 ---> Running in 94fe2f8ce7f2
Removing intermediate container 94fe2f8ce7f2
 ---> 35e96d04ecb1
Successfully built 35e96d04ecb1
Successfully tagged 3c1af3:80a6e1411dc34e96865a7a24d3710fde
##[endgroup]
@wichert
Copy link
Author

wichert commented Jul 11, 2022

Looks like this was fixed in Textualize/rich#2387, but GH/GHE instances may need an update in this action to force a rebuild with a newer rich version.

@webknjaz
Copy link
Member

GH/GHE instances may need an update in this action to force a rebuild with a newer rich version.

AFAIK, the container is built on each run (unless GH changed that). Since this issue is 2 weeks old and nobody else complained, I'm going to assume that it's self-healed now.
This #99 (comment) suggests that having cache: pip with actions/setup-python@v4 was causing the problem (supposedly because ~/ gets mounted into the container).

I've filed #101 to track an ultimate fix for problems of this category, and so I'm closing this issue now.

@webknjaz webknjaz added the bug Something isn't working label Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants