Skip to content

Add util for windows sub-process#2598

Open
LahkLeKey wants to merge 3 commits into
github:mainfrom
LahkLeKey:main
Open

Add util for windows sub-process#2598
LahkLeKey wants to merge 3 commits into
github:mainfrom
LahkLeKey:main

Conversation

@LahkLeKey
Copy link
Copy Markdown

@LahkLeKey LahkLeKey commented May 16, 2026

This pull request adds a utility function to determine the correct executable name for the Copilot CLI based on the operating system. This helps ensure that subprocess calls work reliably across platforms.

Platform compatibility improvement:

  • Added the _copilot_executable() function to return the appropriate Copilot CLI executable name (copilot.cmd on Windows, copilot otherwise), improving subprocess invocation reliability on different platforms.## Description

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

16 failed, 2952 passed, 3 skipped in 335.38s (0:05:35)

========================================================================================================================= short test summary info =========================================================================================================================
FAILED tests/integrations/test_cli.py::TestInitIntegrationFlag::test_shared_infra_skip_warning_displayed - AssertionError: assert 'specify integration upgrade --force' in '\x1b[33m⚠\x1b[0m 1 shared infrastructure file(s) already exist and were not updated: .specify/scripts/bash/common.sh To refresh shared infrastructure, run \x1b[36mspecify init --here --force\x1b[0m ...
FAILED tests/integrations/test_integration_subcommand.py::TestIntegrationList::test_list_shows_multi_install_safe_status - StopIteration
FAILED tests/integrations/test_integration_subcommand.py::TestIntegrationInstall::test_install_already_installed - assert 'specify integration upgrade copilot' in "\x1b[33mIntegration 'copilot' is already installed.\x1b[0m It is already the default integration. To refresh its managed files or options, run \x1b[36mspecify integration upgrade \x1b[0m \x1b[36mcopilot\x1b[0m. No ...
FAILED tests/integrations/test_integration_subcommand.py::TestIntegrationInstall::test_install_different_when_one_exists - assert 'Default integration: copilot' in "\x1b[31mError:\x1b[0m Installed integrations: copilot.\nDefault integration: \x1b[36mcopilot\x1b[0m.\nInstalling multiple integrations is only automatic when all involved \nintegrations are declared multi-install safe.\nT...
FAILED tests/integrations/test_integration_subcommand.py::TestIntegrationInstall::test_install_multi_unsafe_requires_force - assert 'retry the same install command with --force' in "\x1b[31mError:\x1b[0m Installed integrations: copilot. Default integration: \x1b[36mcopilot\x1b[0m. Installing multiple integrations is only automatic when all involved integrations are declared multi-insta...
FAILED tests/test_setup_tasks.py::test_setup_tasks_bash_core_template_resolved - AssertionError: TASKS_TEMPLATE must be an absolute path
FAILED tests/test_setup_tasks.py::test_setup_tasks_bash_override_wins - AssertionError: TASKS_TEMPLATE must be an absolute path
FAILED tests/test_setup_tasks.py::test_setup_tasks_bash_extension_wins_over_core - AssertionError: TASKS_TEMPLATE must be an absolute path
FAILED tests/test_setup_tasks.py::test_setup_tasks_bash_preset_wins_over_extension - AssertionError: TASKS_TEMPLATE must be an absolute path
FAILED tests/test_setup_tasks.py::test_setup_tasks_bash_preset_priority_order - AssertionError: TASKS_TEMPLATE must be an absolute path
FAILED tests/test_timestamp_branches.py::TestTimestampBranch::test_long_name_truncation - AssertionError: [specify] Warning: Branch name exceeded GitHub's 244-byte limit
FAILED tests/test_timestamp_branches.py::TestGetFeaturePathsSinglePrefix::test_bash_specify_feature_prefixed_resolves_by_prefix - AssertionError: assert '/tmp/pytest-...1-target-spec' == 'C:\\Users\\Z...1-target-spec'
FAILED tests/test_timestamp_branches.py::TestFeatureDirectoryResolution::test_env_var_overrides_branch_lookup - assert 'C:\\Users\\<MachineName>\\AppData\\Local\\Temp\\pytest-of-<MachineName>\\pytest-34\\test_env_var_overrides_branch_0\\my-custom-specs\\my-feature' in 'REPO_ROOT=/tmp/pytest-of-<MachineName>/pytest-34/test_env_var_overrides_branch_0\nCURRENT_BRANCH=master\nHAS_GIT=true\nFEATURE_DI...
FAILED tests/test_timestamp_branches.py::TestFeatureDirectoryResolution::test_feature_json_overrides_branch_lookup - AssertionError: assert '/tmp/pytest-...ustom-feature' == 'C:\\Users\\Z...ustom-feature'
FAILED tests/test_timestamp_branches.py::TestFeatureDirectoryResolution::test_env_var_takes_priority_over_feature_json - AssertionError: assert '/tmp/pytest-...\\env-feature' == 'C:\\Users\\Z...\\env-feature'
FAILED tests/test_timestamp_branches.py::TestFeatureDirectoryResolution::test_fallback_to_branch_lookup - AssertionError: assert '/tmp/pytest-...001-test-feat' == 'C:\\Users\\Z...001-test-feat'
========================================================================================================= 16 failed, 2952 passed, 3 skipped in 335.38s (0:05:35) ==========================================================================================================

<MachineName>@<MachineName> MINGW64 /c/Github/spec-kit (main)

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

Ran into this after install when working on other project, probably handy to have

@LahkLeKey LahkLeKey requested a review from mnriem as a code owner May 16, 2026 07:02
Copilot AI review requested due to automatic review settings May 16, 2026 07:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a platform-aware helper to resolve the Copilot CLI executable name, using copilot.cmd on Windows for reliable subprocess invocation.

Changes:

  • New _copilot_executable() helper returning copilot.cmd on Windows and copilot otherwise.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/specify_cli/integrations/copilot/__init__.py
Copilot AI review requested due to automatic review settings May 18, 2026 23:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.

3 participants