poetry install on GitHub actions fails with python version mismatch
Description
Hello, I have a project on which I am using poetry for my dependency management and that I would like to have my unittest running in CI. For the CI I am using GitHub action with their GitHub-hosted runners.
I am aiming to test the project with the 2 min/max python version: python-3.7 and python-3.11.
However it happens that I cannot install my dependencies using poetry install --extras tests when using python-3.7 for my venv. It seems a weird conflict occurs where I get a Exception due to trying to run python-3.10 code with a python-3.7 interpreter (or maybe the other way around ?):
Traceback (most recent call last):
File "<string>", line 18, in <module>
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/tags.py", line 23, in <module>
from . import _manylinux, _musllinux
File "/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/_manylinux.py", line 172, in <module>
@functools.lru_cache
File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/functools.py", line 490, in lru_cache
Error: raise TypeError('Expected maxsize to be an integer or None')
TypeError: Expected maxsize to be an integer or None
Of course everything works fine when running with python-3.11.
Until now this issue have been a nightmare to debug and I tried a lot of options to debug it. I though it was initially related to the setup-python action caching but removing it (or even creating a new repo without it in the first place) did not changed the outcome. I also tested poetry 1.7 and different 1.8 versions but no changes.
During my investigation I stumbled upon https://github.com/actions/setup-python/issues/846 which is partly related but as mentioned it doesn't seems to be a caching problem. At that point I don't care if I use caching or not I just want my CI to work :/
So I'm first opening an issue here but let me know if the issue actually seems to be more on the GitHub action side and potentially setup-python rather than poetry.
resources
- minimal repository where I reproduced the issue: https://github.com/knotsanimation/test_package2
- a recent CI run with the issue: https://github.com/knotsanimation/test_package2/actions/runs/9667483901/job/26669415599
Best, Liam.
Workarounds
No workaround found yet.
Poetry Installation Method
pipx
Operating System
Unbuntu 22.04.4 LTS
Poetry Version
1.8
Poetry Configuration
default configuration
Python Sysconfig
see GitHub action run linked
Example pyproject.toml
https://github.com/knotsanimation/test_package2/blob/5ee12c9588f507327d77f2d5c5599381f17e637a/pyproject.toml
Poetry Runtime Logs
2024-06-25T18:10:02.8028510Z [36;1mpoetry install --extras "tests" --no-interaction --no-cache -vvv[0m
2024-06-25T18:10:02.8089736Z shell: /usr/bin/bash -e {0}
2024-06-25T18:10:02.8090131Z ##[endgroup]
2024-06-25T18:10:03.1699346Z Disabling source caches
2024-06-25T18:10:03.2225444Z Using virtualenv: /home/runner/.cache/pypoetry/virtualenvs/test-package2-X20nZylN-py3.7
2024-06-25T18:10:03.3148858Z Installing dependencies from lock file
2024-06-25T18:10:03.3621557Z
2024-06-25T18:10:03.3622875Z Finding the necessary packages for the current system
2024-06-25T18:10:03.3669501Z
2024-06-25T18:10:03.3670745Z Package operations: 10 installs, 0 updates, 0 removals
2024-06-25T18:10:03.3671528Z
2024-06-25T18:10:03.3678516Z - Installing typing-extensions (4.7.1)
2024-06-25T18:10:03.3684430Z - Installing zipp (3.15.0)
2024-06-25T18:10:03.3686669Z Checking if keyring is available
2024-06-25T18:10:03.3796572Z [keyring:keyring.backend] Loading KWallet
2024-06-25T18:10:03.3803683Z [keyring:keyring.backend] Loading SecretService
2024-06-25T18:10:03.3930663Z [keyring:keyring.backend] Loading Windows
2024-06-25T18:10:03.3931688Z [keyring:keyring.backend] Loading chainer
2024-06-25T18:10:03.3932473Z [keyring:keyring.backend] Loading libsecret
2024-06-25T18:10:03.3940829Z [keyring:keyring.backend] Loading macOS
2024-06-25T18:10:03.4527508Z Backend 'fail Keyring' is not suitable
2024-06-25T18:10:03.4529027Z No valid keyring backend was found
2024-06-25T18:10:03.4530153Z Creating new session for pypi.org
2024-06-25T18:10:03.4551282Z [urllib3:urllib3.connectionpool] Starting new HTTPS connection (1): pypi.org:443
2024-06-25T18:10:03.4555675Z [urllib3:urllib3.connectionpool] Starting new HTTPS connection (2): pypi.org:443
2024-06-25T18:10:03.4650059Z [urllib3:urllib3.connectionpool] https://pypi.org:443 "GET /pypi/typing-extensions/4.7.1/json HTTP/11" 200 1981
2024-06-25T18:10:03.4665172Z [urllib3:urllib3.connectionpool] https://pypi.org:443 "GET /pypi/zipp/3.15.0/json HTTP/11" 200 2104
2024-06-25T18:10:03.6295640Z
2024-06-25T18:10:03.6296679Z Stack trace:
2024-06-25T18:10:03.6297750Z
2024-06-25T18:10:03.6302684Z 2 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:338 in _run
2024-06-25T18:10:03.6495256Z 336│ output = ""
2024-06-25T18:10:03.6496556Z 337│ else:
2024-06-25T18:10:03.6498196Z → 338│ output = subprocess.check_output(
2024-06-25T18:10:03.6500081Z 339│ cmd, stderr=stderr, env=env, text=True, **kwargs
2024-06-25T18:10:03.6501389Z 340│ )
2024-06-25T18:10:03.6558442Z
2024-06-25T18:10:03.6559085Z 1 /usr/lib/python3.10/subprocess.py:421 in check_output
2024-06-25T18:10:03.7057704Z 419│ kwargs['input'] = empty
2024-06-25T18:10:03.7058623Z 420│
2024-06-25T18:10:03.7059621Z → 421│ return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
2024-06-25T18:10:03.7061563Z 422│ **kwargs).stdout
2024-06-25T18:10:03.7062399Z 423│
2024-06-25T18:10:03.7062707Z
2024-06-25T18:10:03.7062944Z CalledProcessError
2024-06-25T18:10:03.7063503Z
2024-06-25T18:10:03.7071930Z Command '['/home/runner/.cache/pypoetry/virtualenvs/test-package2-X20nZylN-py3.7/bin/python', '-I', '-W', 'ignore', '-c', '\nimport importlib.util\nimport json\nimport sys\n\nfrom pathlib import Path\n\nspec = importlib.util.spec_from_file_location(\n "packaging", Path(r"/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/__init__.py")\n)\npackaging = importlib.util.module_from_spec(spec)\nsys.modules[spec.name] = packaging\n\nspec = importlib.util.spec_from_file_location(\n "packaging.tags", Path(r"/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/tags.py")\n)\npackaging_tags = importlib.util.module_from_spec(spec)\nspec.loader.exec_module(packaging_tags)\n\nprint(\n json.dumps([(t.interpreter, t.abi, t.platform) for t in packaging_tags.sys_tags()])\n)\n']' returned non-zero exit status 1.
2024-06-25T18:10:03.7078893Z
2024-06-25T18:10:03.7079247Z at /usr/lib/python3.10/subprocess.py:526 in run
2024-06-25T18:10:03.7589789Z 522│ # We don't call process.wait() as .__exit__ does that for us.
2024-06-25T18:10:03.7591063Z 523│ raise
2024-06-25T18:10:03.7591898Z 524│ retcode = process.poll()
2024-06-25T18:10:03.7592973Z 525│ if check and retcode:
2024-06-25T18:10:03.7594144Z → 526│ raise CalledProcessError(retcode, process.args,
2024-06-25T18:10:03.7595375Z 527│ output=stdout, stderr=stderr)
2024-06-25T18:10:03.7596830Z 528│ return CompletedProcess(process.args, retcode, stdout, stderr)
2024-06-25T18:10:03.7597844Z 529│
2024-06-25T18:10:03.7598426Z 530│
2024-06-25T18:10:03.7598714Z
2024-06-25T18:10:03.7599362Z The following error occurred when trying to handle this error:
2024-06-25T18:10:03.7600141Z
2024-06-25T18:10:03.7600152Z
2024-06-25T18:10:03.7600367Z Stack trace:
2024-06-25T18:10:03.7600731Z
2024-06-25T18:10:03.7601876Z 12 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:281 in _execute_operation
2024-06-25T18:10:03.7863514Z 279│
2024-06-25T18:10:03.7864805Z 280│ try:
2024-06-25T18:10:03.7865826Z → 281│ result = self._do_execute_operation(operation)
2024-06-25T18:10:03.7866966Z 282│ except EnvCommandError as e:
2024-06-25T18:10:03.7868130Z 283│ if e.e.returncode == -2:
2024-06-25T18:10:03.7868708Z
2024-06-25T18:10:03.7870671Z 11 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:391 in _do_execute_operation
2024-06-25T18:10:03.8129537Z 389│ return 0
2024-06-25T18:10:03.8130362Z 390│
2024-06-25T18:10:03.8131672Z → 391│ result: int = getattr(self, f"_execute_{method}")(operation)
2024-06-25T18:10:03.8133395Z 392│
2024-06-25T18:10:03.8134098Z 393│ if result != 0:
2024-06-25T18:10:03.8134567Z
2024-06-25T18:10:03.8135934Z 10 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:516 in _execute_install
2024-06-25T18:10:03.8385818Z 514│
2024-06-25T18:10:03.8386969Z 515│ def _execute_install(self, operation: Install | Update) -> int:
2024-06-25T18:10:03.8389159Z → 516│ status_code = self._install(operation)
2024-06-25T18:10:03.8390051Z 517│
2024-06-25T18:10:03.8390783Z 518│ self._save_url_reference(operation)
2024-06-25T18:10:03.8391589Z
2024-06-25T18:10:03.8392635Z 9 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:554 in _install
2024-06-25T18:10:03.8648294Z 552│ archive = self._download_link(operation, Link(package.source_url))
2024-06-25T18:10:03.8649507Z 553│ else:
2024-06-25T18:10:03.8650407Z → 554│ archive = self._download(operation)
2024-06-25T18:10:03.8652696Z 555│
2024-06-25T18:10:03.8653619Z 556│ operation_message = self.get_operation_message(operation)
2024-06-25T18:10:03.8654415Z
2024-06-25T18:10:03.8655448Z 8 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:732 in _download
2024-06-25T18:10:03.8906097Z 730│
2024-06-25T18:10:03.8907261Z 731│ def _download(self, operation: Install | Update) -> Path:
2024-06-25T18:10:03.8909197Z → 732│ link = self._chooser.choose_for(operation.package)
2024-06-25T18:10:03.8910330Z 733│
2024-06-25T18:10:03.8911049Z 734│ if link.yanked:
2024-06-25T18:10:03.8911512Z
2024-06-25T18:10:03.8912524Z 7 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/chooser.py:59 in choose_for
2024-06-25T18:10:03.8963163Z 57│ continue
2024-06-25T18:10:03.8964073Z 58│
2024-06-25T18:10:03.8966302Z → 59│ if not Wheel(link.filename).is_supported_by_environment(self._env):
2024-06-25T18:10:03.8967772Z 60│ logger.debug(
2024-06-25T18:10:03.8968978Z 61│ "Skipping wheel %s as this is not supported by the current"
2024-06-25T18:10:03.8969713Z
2024-06-25T18:10:03.8971472Z 6 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/wheel.py:47 in is_supported_by_environment
2024-06-25T18:10:03.8985881Z 45│
2024-06-25T18:10:03.8986742Z 46│ def is_supported_by_environment(self, env: Env) -> bool:
2024-06-25T18:10:03.8988722Z → 47│ return bool(set(env.supported_tags).intersection(self.tags))
2024-06-25T18:10:03.8989970Z 48│
2024-06-25T18:10:03.8990275Z
2024-06-25T18:10:03.8991915Z 5 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:248 in supported_tags
2024-06-25T18:10:03.9104007Z 246│ def supported_tags(self) -> list[Tag]:
2024-06-25T18:10:03.9105595Z 247│ if self._supported_tags is None:
2024-06-25T18:10:03.9107444Z → 248│ self._supported_tags = self.get_supported_tags()
2024-06-25T18:10:03.9108414Z 249│
2024-06-25T18:10:03.9109341Z 250│ return self._supported_tags
2024-06-25T18:10:03.9109883Z
2024-06-25T18:10:03.9111038Z 4 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/virtual_env.py:64 in get_supported_tags
2024-06-25T18:10:03.9153413Z 62│
2024-06-25T18:10:03.9154440Z 63│ def get_supported_tags(self) -> list[Tag]:
2024-06-25T18:10:03.9156206Z → 64│ output = self.run_python_script(GET_SYS_TAGS)
2024-06-25T18:10:03.9157334Z 65│
2024-06-25T18:10:03.9158114Z 66│ return [Tag(*t) for t in json.loads(output)]
2024-06-25T18:10:03.9159359Z
2024-06-25T18:10:03.9160489Z 3 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:313 in run_python_script
2024-06-25T18:10:03.9269973Z 311│
2024-06-25T18:10:03.9271564Z 312│ def run_python_script(self, content: str, **kwargs: Any) -> str:
2024-06-25T18:10:03.9272765Z → 313│ return self.run(
2024-06-25T18:10:03.9274364Z 314│ self._executable,
2024-06-25T18:10:03.9275247Z 315│ "-I",
2024-06-25T18:10:03.9275658Z
2024-06-25T18:10:03.9276595Z 2 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:305 in run
2024-06-25T18:10:03.9386291Z 303│ def run(self, bin: str, *args: str, **kwargs: Any) -> str:
2024-06-25T18:10:03.9388177Z 304│ cmd = self.get_command_from_bin(bin) + list(args)
2024-06-25T18:10:03.9389289Z → 305│ return self._run(cmd, **kwargs)
2024-06-25T18:10:03.9390303Z 306│
2024-06-25T18:10:03.9391949Z 307│ def run_pip(self, *args: str, **kwargs: Any) -> str:
2024-06-25T18:10:03.9392645Z
2024-06-25T18:10:03.9393668Z 1 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/virtual_env.py:88 in _run
2024-06-25T18:10:03.9435611Z 86│ def _run(self, cmd: list[str], **kwargs: Any) -> str:
2024-06-25T18:10:03.9437561Z 87│ kwargs["env"] = self.get_temp_environ(environ=kwargs.get("env"))
2024-06-25T18:10:03.9438793Z → 88│ return super()._run(cmd, **kwargs)
2024-06-25T18:10:03.9439749Z 89│
2024-06-25T18:10:03.9441142Z 90│ def get_temp_environ(
2024-06-25T18:10:03.9441694Z
2024-06-25T18:10:03.9441917Z EnvCommandError
2024-06-25T18:10:03.9442500Z
2024-06-25T18:10:03.9450537Z Command ['/home/runner/.cache/pypoetry/virtualenvs/test-package2-X20nZylN-py3.7/bin/python', '-I', '-W', 'ignore', '-c', '\nimport importlib.util\nimport json\nimport sys\n\nfrom pathlib import Path\n\nspec = importlib.util.spec_from_file_location(\n "packaging", Path(r"/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/__init__.py")\n)\npackaging = importlib.util.module_from_spec(spec)\nsys.modules[spec.name] = packaging\n\nspec = importlib.util.spec_from_file_location(\n "packaging.tags", Path(r"/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/tags.py")\n)\npackaging_tags = importlib.util.module_from_spec(spec)\nspec.loader.exec_module(packaging_tags)\n\nprint(\n json.dumps([(t.interpreter, t.abi, t.platform) for t in packaging_tags.sys_tags()])\n)\n'] errored with the following return code 1
2024-06-25T18:10:03.9457590Z
2024-06-25T18:10:03.9458286Z Error output:
2024-06-25T18:10:03.9458922Z Traceback (most recent call last):
2024-06-25T18:10:03.9469183Z File "<string>", line 18, in <module>
2024-06-25T18:10:03.9470581Z File "<frozen importlib._bootstrap_external>", line 728, in exec_module
2024-06-25T18:10:03.9471982Z File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2024-06-25T18:10:03.9473876Z File "/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/tags.py", line 23, in <module>
2024-06-25T18:10:03.9475386Z from . import _manylinux, _musllinux
2024-06-25T18:10:03.9476980Z File "/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/_manylinux.py", line 172, in <module>
2024-06-25T18:10:03.9478370Z @functools.lru_cache
2024-06-25T18:10:03.9479709Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/functools.py", line 490, in lru_cache
2024-06-25T18:10:03.9545114Z ##[error] raise TypeError('Expected maxsize to be an integer or None')
2024-06-25T18:10:03.9556222Z TypeError: Expected maxsize to be an integer or None
2024-06-25T18:10:03.9557090Z
2024-06-25T18:10:03.9557343Z
2024-06-25T18:10:03.9558315Z at /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:342 in _run
2024-06-25T18:10:03.9602185Z 338│ output = subprocess.check_output(
2024-06-25T18:10:03.9604001Z 339│ cmd, stderr=stderr, env=env, text=True, **kwargs
2024-06-25T18:10:03.9605310Z 340│ )
2024-06-25T18:10:03.9606242Z 341│ except CalledProcessError as e:
2024-06-25T18:10:03.9624692Z → 342│ raise EnvCommandError(e)
2024-06-25T18:10:03.9625721Z 343│
2024-06-25T18:10:03.9626331Z 344│ return output
2024-06-25T18:10:03.9627070Z 345│
2024-06-25T18:10:03.9628096Z 346│ def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
2024-06-25T18:10:03.9628833Z
2024-06-25T18:10:03.9629061Z Cannot install zipp.
2024-06-25T18:10:03.9629491Z
2024-06-25T18:10:03.9629501Z
2024-06-25T18:10:03.9629708Z Stack trace:
2024-06-25T18:10:03.9630024Z
2024-06-25T18:10:03.9631141Z 2 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:338 in _run
2024-06-25T18:10:03.9632573Z 336│ output = ""
2024-06-25T18:10:03.9633343Z 337│ else:
2024-06-25T18:10:03.9634361Z → 338│ output = subprocess.check_output(
2024-06-25T18:10:03.9635583Z 339│ cmd, stderr=stderr, env=env, text=True, **kwargs
2024-06-25T18:10:03.9636940Z 340│ )
2024-06-25T18:10:03.9637528Z
2024-06-25T18:10:03.9637928Z 1 /usr/lib/python3.10/subprocess.py:421 in check_output
2024-06-25T18:10:03.9639009Z 419│ kwargs['input'] = empty
2024-06-25T18:10:03.9639771Z 420│
2024-06-25T18:10:03.9640910Z → 421│ return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
2024-06-25T18:10:03.9642074Z 422│ **kwargs).stdout
2024-06-25T18:10:03.9642790Z 423│
2024-06-25T18:10:03.9643271Z
2024-06-25T18:10:03.9643525Z CalledProcessError
2024-06-25T18:10:03.9643880Z
2024-06-25T18:10:03.9651803Z Command '['/home/runner/.cache/pypoetry/virtualenvs/test-package2-X20nZylN-py3.7/bin/python', '-I', '-W', 'ignore', '-c', '\nimport importlib.util\nimport json\nimport sys\n\nfrom pathlib import Path\n\nspec = importlib.util.spec_from_file_location(\n "packaging", Path(r"/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/__init__.py")\n)\npackaging = importlib.util.module_from_spec(spec)\nsys.modules[spec.name] = packaging\n\nspec = importlib.util.spec_from_file_location(\n "packaging.tags", Path(r"/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/tags.py")\n)\npackaging_tags = importlib.util.module_from_spec(spec)\nspec.loader.exec_module(packaging_tags)\n\nprint(\n json.dumps([(t.interpreter, t.abi, t.platform) for t in packaging_tags.sys_tags()])\n)\n']' returned non-zero exit status 1.
2024-06-25T18:10:03.9658579Z
2024-06-25T18:10:03.9658913Z at /usr/lib/python3.10/subprocess.py:526 in run
2024-06-25T18:10:04.0174247Z 522│ # We don't call process.wait() as .__exit__ does that for us.
2024-06-25T18:10:04.0175336Z 523│ raise
2024-06-25T18:10:04.0176192Z 524│ retcode = process.poll()
2024-06-25T18:10:04.0177978Z 525│ if check and retcode:
2024-06-25T18:10:04.0178992Z → 526│ raise CalledProcessError(retcode, process.args,
2024-06-25T18:10:04.0180416Z 527│ output=stdout, stderr=stderr)
2024-06-25T18:10:04.0181773Z 528│ return CompletedProcess(process.args, retcode, stdout, stderr)
2024-06-25T18:10:04.0182855Z 529│
2024-06-25T18:10:04.0183534Z 530│
2024-06-25T18:10:04.0184254Z
2024-06-25T18:10:04.0184717Z The following error occurred when trying to handle this error:
2024-06-25T18:10:04.0185406Z
2024-06-25T18:10:04.0186056Z
2024-06-25T18:10:04.0186394Z Stack trace:
2024-06-25T18:10:04.0186700Z
2024-06-25T18:10:04.0188043Z 12 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:281 in _execute_operation
2024-06-25T18:10:04.0189507Z 279│
2024-06-25T18:10:04.0190174Z 280│ try:
2024-06-25T18:10:04.0191273Z → 281│ result = self._do_execute_operation(operation)
2024-06-25T18:10:04.0192368Z 282│ except EnvCommandError as e:
2024-06-25T18:10:04.0193422Z 283│ if e.e.returncode == -2:
2024-06-25T18:10:04.0193996Z
2024-06-25T18:10:04.0195331Z 11 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:391 in _do_execute_operation
2024-06-25T18:10:04.0196873Z 389│ return 0
2024-06-25T18:10:04.0197619Z 390│
2024-06-25T18:10:04.0198667Z → 391│ result: int = getattr(self, f"_execute_{method}")(operation)
2024-06-25T18:10:04.0200452Z 392│
2024-06-25T18:10:04.0201073Z 393│ if result != 0:
2024-06-25T18:10:04.0201738Z
2024-06-25T18:10:04.0202843Z 10 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:516 in _execute_install
2024-06-25T18:10:04.0204342Z 514│
2024-06-25T18:10:04.0205254Z 515│ def _execute_install(self, operation: Install | Update) -> int:
2024-06-25T18:10:04.0206601Z → 516│ status_code = self._install(operation)
2024-06-25T18:10:04.0207537Z 517│
2024-06-25T18:10:04.0208262Z 518│ self._save_url_reference(operation)
2024-06-25T18:10:04.0209409Z
2024-06-25T18:10:04.0210467Z 9 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:554 in _install
2024-06-25T18:10:04.0212272Z 552│ archive = self._download_link(operation, Link(package.source_url))
2024-06-25T18:10:04.0213378Z 553│ else:
2024-06-25T18:10:04.0214388Z → 554│ archive = self._download(operation)
2024-06-25T18:10:04.0215267Z 555│
2024-06-25T18:10:04.0216172Z 556│ operation_message = self.get_operation_message(operation)
2024-06-25T18:10:04.0217028Z
2024-06-25T18:10:04.0218032Z 8 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/executor.py:732 in _download
2024-06-25T18:10:04.0219442Z 730│
2024-06-25T18:10:04.0220357Z 731│ def _download(self, operation: Install | Update) -> Path:
2024-06-25T18:10:04.0221702Z → 732│ link = self._chooser.choose_for(operation.package)
2024-06-25T18:10:04.0222945Z 733│
2024-06-25T18:10:04.0223935Z 734│ if link.yanked:
2024-06-25T18:10:04.0224556Z
2024-06-25T18:10:04.0226556Z 7 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/chooser.py:59 in choose_for
2024-06-25T18:10:04.0228007Z 57│ continue
2024-06-25T18:10:04.0228932Z 58│
2024-06-25T18:10:04.0229959Z → 59│ if not Wheel(link.filename).is_supported_by_environment(self._env):
2024-06-25T18:10:04.0231157Z 60│ logger.debug(
2024-06-25T18:10:04.0232462Z 61│ "Skipping wheel %s as this is not supported by the current"
2024-06-25T18:10:04.0233209Z
2024-06-25T18:10:04.0234399Z 6 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/wheel.py:47 in is_supported_by_environment
2024-06-25T18:10:04.0235858Z 45│
2024-06-25T18:10:04.0236853Z 46│ def is_supported_by_environment(self, env: Env) -> bool:
2024-06-25T18:10:04.0238264Z → 47│ return bool(set(env.supported_tags).intersection(self.tags))
2024-06-25T18:10:04.0239293Z 48│
2024-06-25T18:10:04.0239719Z
2024-06-25T18:10:04.0240766Z 5 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:248 in supported_tags
2024-06-25T18:10:04.0242378Z 246│ def supported_tags(self) -> list[Tag]:
2024-06-25T18:10:04.0243404Z 247│ if self._supported_tags is None:
2024-06-25T18:10:04.0244612Z → 248│ self._supported_tags = self.get_supported_tags()
2024-06-25T18:10:04.0245581Z 249│
2024-06-25T18:10:04.0246285Z 250│ return self._supported_tags
2024-06-25T18:10:04.0246947Z
2024-06-25T18:10:04.0248104Z 4 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/virtual_env.py:64 in get_supported_tags
2024-06-25T18:10:04.0249617Z 62│
2024-06-25T18:10:04.0250377Z 63│ def get_supported_tags(self) -> list[Tag]:
2024-06-25T18:10:04.0251678Z → 64│ output = self.run_python_script(GET_SYS_TAGS)
2024-06-25T18:10:04.0252564Z 65│
2024-06-25T18:10:04.0253374Z 66│ return [Tag(*t) for t in json.loads(output)]
2024-06-25T18:10:04.0254104Z
2024-06-25T18:10:04.0255248Z 3 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:313 in run_python_script
2024-06-25T18:10:04.0256610Z 311│
2024-06-25T18:10:04.0257550Z 312│ def run_python_script(self, content: str, **kwargs: Any) -> str:
2024-06-25T18:10:04.0258822Z → 313│ return self.run(
2024-06-25T18:10:04.0259604Z 314│ self._executable,
2024-06-25T18:10:04.0260410Z 315│ "-I",
2024-06-25T18:10:04.0260965Z
2024-06-25T18:10:04.0261907Z 2 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:305 in run
2024-06-25T18:10:04.0263487Z 303│ def run(self, bin: str, *args: str, **kwargs: Any) -> str:
2024-06-25T18:10:04.0265152Z 304│ cmd = self.get_command_from_bin(bin) + list(args)
2024-06-25T18:10:04.0266767Z → 305│ return self._run(cmd, **kwargs)
2024-06-25T18:10:04.0267627Z 306│
2024-06-25T18:10:04.0268459Z 307│ def run_pip(self, *args: str, **kwargs: Any) -> str:
2024-06-25T18:10:04.0269283Z
2024-06-25T18:10:04.0271041Z 1 /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/virtual_env.py:88 in _run
2024-06-25T18:10:04.0272670Z 86│ def _run(self, cmd: list[str], **kwargs: Any) -> str:
2024-06-25T18:10:04.0274120Z 87│ kwargs["env"] = self.get_temp_environ(environ=kwargs.get("env"))
2024-06-25T18:10:04.0275274Z → 88│ return super()._run(cmd, **kwargs)
2024-06-25T18:10:04.0276149Z 89│
2024-06-25T18:10:04.0276921Z 90│ def get_temp_environ(
2024-06-25T18:10:04.0277406Z
2024-06-25T18:10:04.0277628Z EnvCommandError
2024-06-25T18:10:04.0278008Z
2024-06-25T18:10:04.0285881Z Command ['/home/runner/.cache/pypoetry/virtualenvs/test-package2-X20nZylN-py3.7/bin/python', '-I', '-W', 'ignore', '-c', '\nimport importlib.util\nimport json\nimport sys\n\nfrom pathlib import Path\n\nspec = importlib.util.spec_from_file_location(\n "packaging", Path(r"/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/__init__.py")\n)\npackaging = importlib.util.module_from_spec(spec)\nsys.modules[spec.name] = packaging\n\nspec = importlib.util.spec_from_file_location(\n "packaging.tags", Path(r"/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/tags.py")\n)\npackaging_tags = importlib.util.module_from_spec(spec)\nspec.loader.exec_module(packaging_tags)\n\nprint(\n json.dumps([(t.interpreter, t.abi, t.platform) for t in packaging_tags.sys_tags()])\n)\n'] errored with the following return code 1
2024-06-25T18:10:04.0293026Z
2024-06-25T18:10:04.0293583Z Error output:
2024-06-25T18:10:04.0294218Z Traceback (most recent call last):
2024-06-25T18:10:04.0295273Z File "<string>", line 18, in <module>
2024-06-25T18:10:04.0296416Z File "<frozen importlib._bootstrap_external>", line 728, in exec_module
2024-06-25T18:10:04.0297775Z File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2024-06-25T18:10:04.0299748Z File "/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/tags.py", line 23, in <module>
2024-06-25T18:10:04.0301126Z from . import _manylinux, _musllinux
2024-06-25T18:10:04.0302720Z File "/opt/pipx/venvs/poetry/lib/python3.10/site-packages/packaging/_manylinux.py", line 172, in <module>
2024-06-25T18:10:04.0304450Z @functools.lru_cache
2024-06-25T18:10:04.0305729Z File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/functools.py", line 490, in lru_cache
2024-06-25T18:10:04.0308336Z ##[error] raise TypeError('Expected maxsize to be an integer or None')
2024-06-25T18:10:04.0310561Z TypeError: Expected maxsize to be an integer or None
2024-06-25T18:10:04.0311347Z
2024-06-25T18:10:04.0311820Z
2024-06-25T18:10:04.0312768Z at /opt/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env/base_env.py:342 in _run
2024-06-25T18:10:04.0374866Z 338│ output = subprocess.check_output(
2024-06-25T18:10:04.0376829Z 339│ cmd, stderr=stderr, env=env, text=True, **kwargs
2024-06-25T18:10:04.0377846Z 340│ )
2024-06-25T18:10:04.0378688Z 341│ except CalledProcessError as e:
2024-06-25T18:10:04.0380739Z → 342│ raise EnvCommandError(e)
2024-06-25T18:10:04.0381419Z 343│
2024-06-25T18:10:04.0382036Z 344│ return output
2024-06-25T18:10:04.0382809Z 345│
2024-06-25T18:10:04.0383553Z 346│ def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
2024-06-25T18:10:04.0384476Z
2024-06-25T18:10:04.0384826Z Cannot install typing-extensions.
The code in question already has been removed from the main branch so I guess this will go away at next release.
Meanwhile I suppose no-one else cares about python 3.7 - which is a year past end of life. Perhaps you shouldn't either?
Hey thanks I guess that is good news. However by "code in question" do you mean the functools.lru_cache call ? Even if removed I guess there is still something weird happening right ?
As for python-3.7 I am working in the VFX industry where we haven't even moved entirely from python-2.7, so just to say it does matter for some people ! If poetry doesn't support python-3.7 venv fine but then it should be mentioned in the doc so I can track down an old version that still supports it.
Even if removed I guess there is still something weird happening right ?
If you want to know whether the main branch of poetry fixes your issue you should try it.
I indeed confirm the main branch works: https://github.com/knotsanimation/test_package2/actions/runs/9670244656/job/26678592345 So thanks for that !
However my question was more that maybe the issue is still here and is just not triggered anymore but I guess that is up to you maintainers to decide.
I am fine with closing this issue and I will eagerly wait for the next release then. Thanks again, Liam.
I'm experiencing this too in our CI where we still provide support for Python 3.7 in our codebase. If Poetry is no longer supporting 3.7 venvs, does it mean that it also won't be able to build for Python 3.7?
this issue is fixed in the main branch and should be closed
Fixed on main
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.