Skip to content

Moving Poetry install directory to $GITHUB_WORKSPACE/.cache breaks nps lint with default excludes #33

Closed

Description

@bkeryan

Bug Report

Upgrading nidaqmx-python to ni/python-actions v0.6.0 fails because this directory is not in ni-python-styleguide's default exclude list.

Repro or Code Sample

https://github.com/ni/nidaqmx-python/actions/runs/18046886197/job/51359726494?pr=845

Expected Behavior

Existing workflows continue to work.

Current Behavior

Existing workflows now emit style errors for files in .cache:

Run poetry run ni-python-styleguide lint
/home/runner/work/nidaqmx-python/nidaqmx-python/.venv/lib/python3.9/site-packages/flake8_import_order/styles.py:3: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import iter_entry_points
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:1:1: D100 Missing docstring in public module
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'AbstractSet' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'AnyStr' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'BinaryIO' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'Callable' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'Collection' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'Container' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'Dict' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'FrozenSet' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'Hashable' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'IO' in __all__
./.cache/poetry/home/lib/python3.9/site-packages/typing_extensions.py:21:1: F822 undefined name 'ItemsView' in __all__

Possible Solution

  • Move it out of $GITHUB_WORKSPACE
  • Change ni-python-styleguide default excludes

Context

ni/nidaqmx-python#845

Your Environment

  • ni/python-actions version: v0.6.0
  • Python version: 3.11.9

AB#3336072

Activity

  1. bkeryan commented on Sep 26, 2025

    @bkeryan
    CollaboratorAuthor

    FYI @mshafer-NI @szb640

    I think we should make the poetry dir configurable and default to the old location. @szb640 's workflows would have to opt-in to a custom location.

  2. bkeryan commented on Sep 26, 2025

    @bkeryan
    CollaboratorAuthor

    FYI @mshafer-NI @szb640

    I think we should make the poetry dir configurable and default to the old location. @szb640 's workflows would have to opt-in to a custom location.

    On further thought, $GITHUB_WORKSPACE includes the repo name twice, like /home/runner/work/my-repo-name/my-repo-name. The inner my-repo-name is the default checkout location. Are actions allowed to use the outer my-repo-name directory?

  3. bkeryan commented on Sep 26, 2025

    @bkeryan
    CollaboratorAuthor

    Another approach is to use a post action to clean up the Poetry install. However, I think these are only available to Javascript and Docker actions, not composite actions.

  4. bkeryan commented on Sep 26, 2025

    @bkeryan
    CollaboratorAuthor

    The outer my-repo-name directory is the "pipeline directory" and it looks like the runner may delete it.

    https://github.com/actions/runner/blob/main/src/Runner.Worker/PipelineDirectoryManager.cs#L70

  5. self-assigned this
    on Sep 26, 2025
  6. bkeryan commented on Sep 29, 2025

    @bkeryan
    CollaboratorAuthor

    @mshafer-NI @szb640 This also broke ni/python-actions/update-project-version. The .cache directory is not listed in most repos' .gitignore file, so the entire Poetry venv gets added to the PR.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions