Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chronus/changes/python-tooling-minimums-2026-10-22.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/http-client-python"
---

Upgrade pip in existing generator virtual environments as well as newly created ones.
18 changes: 18 additions & 0 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Install repo dependencies
run: pnpm install

- name: Upgrade Python installers
run: python -m pip install --upgrade "pip>=26.2.2" "uv>=0.13.4"

- name: Setup http-client-python
# Avoid npm lifecycle side effects and lockfile rewrites in CI; setup still runs build + generator install.
run: |
Expand Down Expand Up @@ -82,6 +85,9 @@ jobs:
- name: Install repo dependencies
run: pnpm install

- name: Upgrade Python installers
run: python -m pip install --upgrade "pip>=26.2.2" "uv>=0.13.4"

- name: Setup http-client-python
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
run: |
Expand Down Expand Up @@ -116,6 +122,9 @@ jobs:
- name: Install repo dependencies
run: pnpm install

- name: Upgrade Python installers
run: python -m pip install --upgrade "pip>=26.2.2" "uv>=0.13.4"

- name: Setup http-client-python
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
run: |
Expand Down Expand Up @@ -150,6 +159,9 @@ jobs:
- name: Install repo dependencies
run: pnpm install

- name: Upgrade Python installers
run: python -m pip install --upgrade "pip>=26.2.2" "uv>=0.13.4"

- name: Setup http-client-python
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
run: |
Expand Down Expand Up @@ -195,6 +207,9 @@ jobs:
- name: Install repo dependencies
run: pnpm install

- name: Upgrade Python installers
run: python -m pip install --upgrade "pip>=26.2.2" "uv>=0.13.4"

- name: Setup http-client-python
# Generated artifacts come from the build job; downstream jobs only need the Python package installed and test tools prepared.
run: |
Expand Down Expand Up @@ -225,6 +240,9 @@ jobs:
- name: Install repo dependencies
run: pnpm install

- name: Upgrade Python installers
run: python -m pip install --upgrade "pip>=26.2.2" "uv>=0.13.4"

- name: Setup http-client-python
# Windows validates build/regenerate/test in one job, so run the full setup instead of restoring Linux artifacts.
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,17 @@ def __init__(self, venv_path):
else str(venv_path / "Scripts" / "python.exe")
)

return MockVenvContext(venv_path)
context = MockVenvContext(venv_path)
install_packages(["--upgrade", "pip"], context, package_manager="uv")
return context
else:
# Use standard venv for pip
if venv_path.exists():
env_builder = venv.EnvBuilder(with_pip=True)
return env_builder.ensure_directories(venv_path)
context = env_builder.ensure_directories(venv_path)
install_packages(["--upgrade", "pip"], context, package_manager)
else:
env_builder = ExtendedEnvBuilder(with_pip=True, upgrade_deps=True)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this technically should upgrade deps but I dont know if it guarentees the lowest min version

env_builder.create(venv_path)
return env_builder.context
context = env_builder.context
return context
14 changes: 4 additions & 10 deletions packages/http-client-python/tests/install_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,10 @@ def build_wheels(flavor, tests_dir):
batch_size = 50
for i in range(0, len(packages), batch_size):
batch = packages[i:i + batch_size]
try:
subprocess.run(
["uv", "pip", "wheel", "--no-deps", "--wheel-dir", wheel_dir] + batch,
check=True,
)
except FileNotFoundError:
subprocess.run(
[sys.executable, "-m", "pip", "wheel", "--no-deps", "--wheel-dir", wheel_dir] + batch,
check=True,
)
subprocess.run(
[sys.executable, "-m", "pip", "wheel", "--no-deps", "--wheel-dir", wheel_dir] + batch,
check=True,
)

wheel_count = len(glob.glob(os.path.join(wheel_dir, "*.whl")))
print(f"Built {wheel_count} wheels for {flavor}")
Expand Down
2 changes: 1 addition & 1 deletion packages/http-client-python/tests/requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Documentation dependencies
-r base.txt
pip
pip>=26.2.2
pylint
pkginfo
sphinx>=7.0.0
Expand Down
Loading