Skip to content

fix: isolate container pip from host pythonpath in package-app-dependencies hook#224

Merged
athreya-splunk merged 1 commit into
mainfrom
fix_precommit_failure
May 4, 2026
Merged

fix: isolate container pip from host pythonpath in package-app-dependencies hook#224
athreya-splunk merged 1 commit into
mainfrom
fix_precommit_failure

Conversation

@athreya-splunk
Copy link
Copy Markdown
Contributor

@athreya-splunk athreya-splunk commented Apr 29, 2026

Fix package-app-dependencies failing in CI due to host pre-commit PYTHONPATH leaking into container pip. The pre-commit env is now created on Python 3.13 with newer pip, and container pip3.9 was importing that
host pip, causing a dataclass(..., slots=True) crash. This change isolates the pre-commit path for local_hooks imports only and clears it for container pip commands.

Tested here by creating temporary PR with this branch as ref splunk-soar-connectors/salesforce#24

Run verifying fix in repo with wheels in it - https://github.com/splunk-soar-connectors/googleworkspacefordrive/pull/35/changes (no more TypeError: dataclass() got an unexpected keyword argument 'slots' error

Failure seen in multiple repos -
https://github.com/splunk-soar-connectors/salesforce/actions/runs/25104646229/job/73562620180?pr=22

Traceback (most recent call last):
File "/opt/python/cp39-cp39/bin/pip3.9", line 8, in <module>
  sys.exit(main())
File "/site-packages/pip/_internal/cli/main.py", line 47, in main
  from pip._internal.cli.autocompletion import autocomplete
File "/site-packages/pip/_internal/cli/autocompletion.py", line 12, in <module>
  from pip._internal.cli.main_parser import create_main_parser
File "/site-packages/pip/_internal/cli/main_parser.py", line 11, in <module>
  from pip._internal.build_env import get_runnable_pip
File "/site-packages/pip/_internal/build_env.py", line 22, in <module>
  from pip._internal.cli.spinners import open_rich_spinner, open_spinner
File "/site-packages/pip/_internal/cli/spinners.py", line 22, in <module>
  from pip._internal.utils.logging import get_console, get_indentation
File "/site-packages/pip/_internal/utils/logging.py", line 32, in <module>
  from pip._internal.utils.misc import StreamWrapper, ensure_dir
File "/site-packages/pip/_internal/utils/misc.py", line 36, in <module>
  from pip._internal.locations import get_major_minor_version
File "/site-packages/pip/_internal/locations/__init__.py", line 10, in <module>
  from pip._internal.models.scheme import SCHEME_KEYS, Scheme
File "/site-packages/pip/_internal/models/scheme.py", line 13, in <module>
  @dataclass(frozen=True, slots=True)
TypeError: dataclass() got an unexpected keyword argument 'slots'

@athreya-splunk athreya-splunk marked this pull request as draft April 29, 2026 11:14
@athreya-splunk athreya-splunk changed the title fix: isolate container pip from host PYTHONPATH in package-app-dependencies hook fix: isolate container pip from host pythonpath in package-app-dependencies hook Apr 30, 2026
@athreya-splunk athreya-splunk marked this pull request as ready for review April 30, 2026 12:01
@athreya-splunk athreya-splunk force-pushed the fix_precommit_failure branch from 3906170 to 3bc756a Compare April 30, 2026 13:31
@athreya-splunk athreya-splunk force-pushed the fix_precommit_failure branch from 3bc756a to 53691ba Compare April 30, 2026 13:33
@athreya-splunk athreya-splunk merged commit 6c286b7 into main May 4, 2026
4 checks passed
@athreya-splunk athreya-splunk deleted the fix_precommit_failure branch May 4, 2026 16:12
@mnordby-splunk
Copy link
Copy Markdown
Contributor

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.

2 participants