Skip to content

fix: use existing executable or unversioned python#96

Draft
zimeg wants to merge 2 commits intomainfrom
zimeg-fix-bin-python
Draft

fix: use existing executable or unversioned python#96
zimeg wants to merge 2 commits intomainfrom
zimeg-fix-bin-python

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Feb 26, 2026

Summary

This PR uses the existing executable or an unversioned python command otherwise. Fixes #70.

Testing

WIP.

Special notes

These changes shouldn't break the experience for Unix, despite the python3 alias being somewhat common. I understand that this option is most relevant when creating a virtual environment, but afterward all aliases point to the same version it seems:

(.venv) $ ls .venv/bin
python -> python3.13*
python3 -> python3.13*
python3.13 -> /opt/homebrew/opt/python@3.13/bin/python3.13*

Windows setups don't include aliases from what I find:

(.venv) PS C:> ls .\.venv\Scripts
python.exe
(.venv) PS C:> python --version
Python 3.14.0

We might make additional changes to the upstream init command if this seems correct as well:

https://github.com/slackapi/slack-cli/blob/a2df7c635e6ba442f51220f6a88c57ed9b64b521/internal/runtime/python/hooks.json#L3

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_and_run_tests.sh after making the changes.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg added this to the 0.4.0 milestone Feb 26, 2026
@zimeg zimeg self-assigned this Feb 26, 2026
@zimeg zimeg added bug Something isn't working semver:patch labels Feb 26, 2026
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.73%. Comparing base (b53cab3) to head (c4d5644).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #96      +/-   ##
==========================================
+ Coverage   94.68%   94.73%   +0.05%     
==========================================
  Files          11       11              
  Lines         207      209       +2     
==========================================
+ Hits          196      198       +2     
  Misses         11       11              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zimeg
Copy link
Member Author

zimeg commented Feb 26, 2026

🔍 From a Windows machine:

[2026-02-26 10:08:36] starting hook command: python -m slack_cli_hooks.hooks.get_hooks
[2026-02-26 10:08:37] {"hooks": {"get-manifest": "'C:\\Users\\user\\programming\\slack-cli\\strange-orca-513\\.venv\\Scripts\\python.exe' -m slack_cli_hooks.hooks.get_manifest", "start": "'C:\\Users\\user\\programming\\slack-cli\\strange-orca-513\\.venv\\Scripts\\python.exe' -X dev -m slack_cli_hooks.hooks.start", "check-update": "'C:\\Users\\user\\programming\\slack-cli\\strange-orca-513\\.venv\\Scripts\\python.exe' -m slack_cli_hooks.hooks.check_update", "doctor": "'C:\\Users\\user\\programming\\slack-cli\\strange-orca-513\\.venv\\Scripts\\python.exe' -m slack_cli_hooks.hooks.doctor"}, "config": {"protocol-version": ["message-boundaries", "default"], "sdk-managed-connection-enabled": true, "watch": {"app": {"filter-regex": "\\.py$", "paths": ["."]}, "manifest": {"paths": ["manifest.json"]}}}, "runtime": "python"}
[2026-02-26 10:08:37] finished hook command: python -m slack_cli_hooks.hooks.get_hooks
[2026-02-26 10:08:37] initialized SDK CLI config: {Runtime:python Hooks:{BuildProject:{Command: Name:BuildProject} CheckUpdate:{Command:'C:\Users\user\programming\slack-cli\strange-orca-513\.venv\Scripts\python.exe' -m slack_cli_hooks.hooks.check_update Name:CheckUpdate} Deploy:{Command: Name:Deploy} Doctor:{Command:'C:\Users\user\programming\slack-cli\strange-orca-513\.venv\Scripts\python.exe' -m slack_cli_hooks.hooks.doctor Name:Doctor} GetHooks:{Command:python -m slack_cli_hooks.hooks.get_hooks Name:GetHooks} GetManifest:{Command:'C:\Users\user\programming\slack-cli\strange-orca-513\.venv\Scripts\python.exe' -m slack_cli_hooks.hooks.get_manifest Name:GetManifest} GetTrigger:{Command: Name:GetTrigger} InstallUpdate:{Command: Name:InstallUpdate} Start:{Command:'C:\Users\user\programming\slack-cli\strange-orca-513\.venv\Scripts\python.exe' -X dev -m slack_cli_hooks.hooks.start Name:Start}} Config:{Watch:{FilterRegex: Paths:[]} SDKManagedConnection:true TriggerPaths:[] SupportedProtocols:[message-boundaries default]} WorkingDirectory:}
[2026-02-26 10:08:37] initialize runtime from hooks.json: Python (python)

And:

> Failed to get app manifest details. Please check your manifest file. (invalid_manifest)
   Error running 'GetManifest' command: exit status 1 (sdk_hook_invocation_failed)
   Suggestion: Run `slack.exe doctor` to check that your system dependencies are up-to-date.

   At line:1 char:81
   + ... mming\slack-cli\strange-orca-513\.venv\Scripts\python.exe' -m slack_c ...
   +                                                                ~~
   Unexpected token '-m' in expression or statement.
   At line:1 char:84
   + ... env\Scripts\python.exe' -m slack_cli_hooks.hooks.get_manifest --sourc ...
   +                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Unexpected token 'slack_cli_hooks.hooks.get_manifest' in expression or statement.
       + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
       + FullyQualifiedErrorId : UnexpectedToken

@zimeg
Copy link
Member Author

zimeg commented Feb 26, 2026

🤖 Goodness gracious the laptop I have is out of battery. Will continue testing this later.

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

Labels

bug Something isn't working semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "python" runtime executable is not detected on Windows machines

1 participant