Skip to content

Conversation

@bkeryan
Copy link
Collaborator

@bkeryan bkeryan commented Sep 26, 2025

What does this Pull Request accomplish?

Move the Poetry installation from $GITHUB_WORKSPACE/.cache/poetry to $GITHUB_WORKSPACE/../.cache/poetry. This hides the Poetry installation from any tools (such as ni-python-styleguide, mypy, pyright, etc.) that search $GITHUB_WORKSPACE for Python files.

The GitHub runner software sets $GITHUB_WORKSPACE to end in my-repo-name/my-repo-name, which is mentioned in the documentation. The outer my-repo-name directory is called the "pipeline directory" in the runner source code and appears to be deleted along with the workspace directory, but isn't really discussed in the documentation.

Why should this Pull Request be merged?

Fixes #33

What testing has been done?

Installing the current project: test-project (0.1.0)
Run poetry run ni-python-styleguide lint
/home/runner/.cache/pypoetry/virtualenvs/test-project-Yn0-klAp-py3.13/lib/python3.13/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.13/site-packages/anyio/__init__.py:1:1: D104 Missing docstring in public package
./.cache/poetry/home/lib/python3.13/site-packages/anyio/__init__.py:27:1: I100 Import statements are in the wrong order. 'from ._core._fileio import open_file' should be before 'from ._core._fileio import Path'
./.cache/poetry/home/lib/python3.13/site-packages/anyio/__init__.py:33:1: I100 Import statements are in the wrong order. 'from ._core._sockets import as_connectable' should be before 'from ._core._sockets import UNIXConnectable'
./.cache/poetry/home/lib/python3.13/site-packages/anyio/__init__.py:68:1: I100 Import statements are in the wrong order. 'from ._core._tasks import CancelScope' should be before 'from ._core._tasks import TASK_STATUS_IGNORED'
./.cache/poetry/home/lib/python3.13/site-packages/anyio/__init__.py:77:1: I100 Import statements are in the wrong order. 'from ._core._tempfile import gettempdir' should be before 'from ._core._tempfile import TemporaryFile'

@bkeryan bkeryan requested a review from mshafer-NI as a code owner September 26, 2025 21:22
@bkeryan
Copy link
Collaborator Author

bkeryan commented Sep 26, 2025

FYI @szb640 I don't have a non-ephemeral self-hosted runner to test with. Could you test this with your workflows?

@bkeryan bkeryan merged commit d08837a into main Sep 29, 2025
264 checks passed
@bkeryan bkeryan deleted the users/bkeryan/fix-setup-poetry-dir branch September 29, 2025 16:13
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

Successfully merging this pull request may close these issues.

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

4 participants