Skip to content

Respect pip configuration when bootstrapping Cookiecutter - #8669

Merged
Stella Huang (StellaHuang95) merged 1 commit into
microsoft:mainfrom
StellaHuang95:stellahuang-microsoft-fix-cookiecutter-pip-config
Nov 12, 2026
Merged

Stella Huang (StellaHuang95) merged 1 commit into
microsoft:mainfrom
StellaHuang95:stellahuang-microsoft-fix-cookiecutter-pip-config

Conversation

@StellaHuang95

Copy link
Copy Markdown
Contributor

Summary

  • run CPython's ensurepip in a child process so its PIP_* cleanup cannot disable configuration for the following pip upgrade
  • preserve the existing IronPython bootstrap path and all legacy fallback behavior
  • add a regression test that verifies configured pip settings survive and both bootstrap commands are constructed correctly

User impact

Cookiecutter setup now honors the user's normal pip configuration, including private or corporate package feeds, instead of unexpectedly contacting public PyPI after ensurepip runs.

Validation

  • built VSInterpretersTests for Dev18
  • EnsurePipPreservesPipConfiguration: passed
  • deterministic VSInterpretersTests selection: 9/9 passed
  • fresh Python 3.13 --without-pip environment: bootstrap used the configured feed, made no files.pythonhosted.org requests, installed Cookiecutter 2.7.1 and future, and passed cookiecutter_check.py
  • cloned and loaded the context for the exact template reported in the issue: brettcannon/python-azure-web-app-cookiecutter
  • verified the baseline implementation reproduces the lost configuration

The existing environment-dependent DetectReqPkgMissingPython3Async test failed once during the full assembly run and hung when isolated; its legacy package setup passes independently and it does not exercise this change.

Fixes #8605

Run ensurepip in a child CPython process so its pip environment cleanup does not affect the subsequent package upgrade. Preserve IronPython behavior and add a regression test for configured pip settings.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f7ba6e19-b52e-4441-9c57-830ac221172c
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@sonarqubecloud

Copy link
Copy Markdown

@StellaHuang95

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@rchiodo

Copy link
Copy Markdown
Contributor

🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR.

@rchiodo

Copy link
Copy Markdown
Contributor

Reviewed commit: 59f20e655933e8633e49825b9e0bfb9d044a4981

Result: 🔴 could-not-verify

Verification details

Verification: Automated verification is best effort. The PR author remains responsible for testing.

Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: Podman machine &#x27;pyrx-automation&#x27; is not running.

Test runs: none recorded.

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved via Review Center.

@rchiodo Rich Chiodo (rchiodo) added the review-auto:approved Automated review: no blocking findings (approval posted). label Nov 12, 2026
@StellaHuang95
Stella Huang (StellaHuang95) merged commit 999ac2c into microsoft:main Nov 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to install cookiecutter template.

2 participants