Skip to content

analyze-project cache key should take Poetry version into account #105

Open

Description

@bkeryan

Bug Report

The Poetry version affects the virtualenv version, which affects the version of pip installed into the project venv.

If you use an old version of Poetry with a new version of Python, it may install an old version of pip that is not compatible with the new version of Python.

Repro or Code Sample

https://github.com/ni/nitypes-python/actions/runs/41540286088/job/125603315024?pr=303

Expected Behavior

Updating the Poetry version makes the workflow pass.

Current Behavior

Updating the Poetry version did not solve the problem because the cached project venv was installed with an old version of Poetry.

Run poetry run pip list
Traceback (most recent call last):
  File "<frozen runpy>", line 201, in _run_module_as_main
  File "<frozen runpy>", line 87, in _run_code
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/__main__.py", line 22, in <module>
    from pip._internal.cli.main import main as _main
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/_internal/cli/main.py", line 11, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/_internal/cli/main_parser.py", line 9, in <module>
    from pip._internal.build_env import get_runnable_pip
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/_internal/build_env.py", line 17, in <module>
    from pip._internal.cli.spinners import open_spinner
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/_internal/cli/spinners.py", line 9, in <module>
    from pip._internal.utils.logging import get_indentation
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/_internal/utils/logging.py", line 29, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/_internal/utils/misc.py", line 44, in <module>
    from pip._internal.utils.retry import retry
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/_internal/utils/retry.py", line 5, in <module>
    from pip._vendor.typing_extensions import ParamSpec
  File "/Users/runner/work/nitypes-python/nitypes-python/.venv/lib/python3.15t/site-packages/pip/_vendor/typing_extensions.py", line 3641, in <module>
    no_type_check_decorator = typing.no_type_check_decorator
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/PythonT.framework/Versions/3.15/lib/python3.15t/typing.py", line 3947, in __getattr__
    raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
Error: Process completed with exit code 1.

Workaround

gh cache delete --all

Possible Solution

Add Poetry version to the analyze-project cache key.

Do the same for client workflows that cache the project venv. #38 would help here.

Context

Adding Python 3.15 support to projects.

Your Environment

  • ni/python-actions version: main
  • Python version: 3.15.2

AB#4155695

Activity

  1. added
    bug
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions