Skip to content

Scope PYTHON_GIL=0 off the PyPI publish job - #310

Merged
lbliii merged 1 commit into
mainfrom
chore/standardize-pypi-gil-scoping
Aug 5, 2026
Merged

Scope PYTHON_GIL=0 off the PyPI publish job#310
lbliii merged 1 commit into
mainfrom
chore/standardize-pypi-gil-scoping

Conversation

@lbliii

@lbliii lbliii commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep PYTHON_GIL=0 on free-threaded gate/build jobs only
  • Never inherit GIL=0 into pypi-publish
  • Document the shared Trusted Publishing rule across chirp / kida / furatena / pounce / milo-cli

Test plan

  • Workflow has no top-level PYTHON_GIL
  • pypi-publish has no PYTHON_GIL

Keep free-threaded GIL=0 on gate/build only, never workflow-wide or on
pypa/gh-action-pypi-publish, matching the shared Trusted Publishing rule.
Copilot AI lite review requested due to automatic review settings August 5, 2026 19:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens the GitHub Actions release-to-PyPI workflow so PYTHON_GIL=0 is only applied to the free-threaded (3.14t) gate/build jobs, and is never inherited by the pypa/gh-action-pypi-publish upload job (which is incompatible with PYTHON_GIL=0).

Changes:

  • Scope PYTHON_GIL: "0" to release-gate and release-build job-level env in .github/workflows/python-publish.yml, avoiding any workflow-wide inheritance.
  • Add a regression test ensuring pypi-publish does not see PYTHON_GIL and that the workflow documents the rule.
  • Add a changelog fragment documenting the Trusted Publishing / free-threaded scoping rule.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/templates/test_github_report_contracts.py Adds a contract test to ensure PYTHON_GIL is not set at workflow scope and is absent from pypi-publish.
changelog.d/+pypi-gil-scoping.changed.md Documents the Trusted Publishing scoping behavior for PYTHON_GIL=0.
.github/workflows/python-publish.yml Moves PYTHON_GIL=0 to job scope for gate/build and ensures publish job does not inherit it; expands documentation of the rule.

"""pypa upload container is not free-threaded; GIL=0 belongs on our jobs only."""
workflow = (WORKFLOWS_DIR / "python-publish.yml").read_text(encoding="utf-8")

assert "\nenv:\n PYTHON_GIL:" not in workflow
@lbliii
lbliii merged commit fab06a5 into main Aug 5, 2026
15 checks passed
@lbliii
lbliii deleted the chore/standardize-pypi-gil-scoping branch August 5, 2026 20:01
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