ソース情報
- リポジトリ
- getsentry/pypi
- ソースの最終更新活動
- 2026年2月26日 02:56
- 検出された SKILL.md の言語
- 英語
- スター
- 22
- フォーク
- 5
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
メニュー
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/getsentry/pypi --skill upgrade-pythonコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
SOC 職業分類に基づく
SKILL.md を表示中
| name | upgrade-python |
| description | workflow to rebuild all packages against a newer python version |
Adds support for a new Python version by building all packages, identifying failures, and marking them with python_versions restrictions.
/upgrade-python <full-version>
Example: /upgrade-python 3.14.3
The argument is the full Python version (e.g., 3.14.3). Derive the major.minor (3.14) and cpython tag (cp314) from it.
Edit these files to build ONLY the new Python version (this speeds up CI dramatically):
build.py line 35Change PYTHONS to only the new version:
PYTHONS = ((3, 14),) # temporarily building only new version
validate.py line 19Same change:
PYTHONS = ((3, 14),) # temporarily building only new version
docker/install-pythons line 9Change VERSIONS to only the new full version:
VERSIONS = ("3.14.3",) # temporarily building only new version
docker/DockerfileLine 39 — keep only the new cpython PATH entry (the base image already provides python3.11 on PATH):
PATH=/venv/bin:/opt/python/cp314-cp314/bin:$PATH \
Line 51 — use python3.11 directly (provided by the base image) instead of the installed cpython path:
&& python3.11 -m venv /venv \
.github/workflows/build.ymlThe production workflow uses pre-built :latest images. During a Python upgrade, the Dockerfile has changes that aren't in the production image yet, so you must temporarily add an image job that builds and pushes the modified image, and wire the linux job to use it.
Add a temporary image job before the linux job:
image:
strategy:
matrix:
include:
- {arch: amd64, os: ubuntu-latest}
- {arch: arm64, os: ubuntu-24.04-arm}
runs-on: ${{ matrix.os }}
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- run: docker login --username '${{ github.actor }}' --password-stdin ghcr.io <<< '${{ secrets.GITHUB_TOKEN }}'
- run: |
docker buildx build \
--cache-from ghcr.io/getsentry/pypi-manylinux-${{ matrix.arch }}-ci:latest \
--cache-to type=inline \
--platform linux/${{ matrix.arch }} \
--tag ghcr.io/getsentry/pypi-manylinux-${{ matrix.arch }}-ci:${{ github.sha }} \
${{ github.ref == 'refs/heads/main' && format('--tag ghcr.io/getsentry/pypi-manylinux-{0}-ci:latest', matrix.arch) || '' }} \
--push \
docker
Modify the linux job to depend on image and use the SHA-tagged image:
linux:
needs: [image]
...
container: ghcr.io/getsentry/pypi-manylinux-${{ matrix.arch }}-ci:${{ github.sha }}
macOS PATH entries — keep only the new cpython PATH entry:
- run: |
echo "$PWD/pythons/cp314-cp314/bin" >> "$GITHUB_PATH"
echo "$PWD/venv/bin" >> "$GITHUB_PATH"
Add --upgrade-python flag to both linux and macos build commands:
- run: python3 -um build --pypi-url https://pypi.devinfra.sentry.io --upgrade-python
Commit all changes with a message like "build: single-version mode for Python 3.14 upgrade" and push.
Wait for CI to complete (it will likely fail — that's expected).
Use gh run watch to avoid rate limits if polling.
Download logs from each build job using the GitHub CLI:
# Get the workflow run
gh run list --branch <current-branch> --limit 1
# Get job IDs from the run
gh run view <run-id> --json jobs --jq '.jobs[] | {name: .name, id: .databaseId, conclusion: .conclusion}'
# Download logs for each job
gh api repos/getsentry/pypi/actions/jobs/<job-id>/logs > job-<name>.log
Parse the logs to identify:
=== <name>==<version>@<python> that are NOT followed by !!! FAILED: or !!! SKIPPED!!! FAILED: <name>==<version>: <error message>!!! SKIPPED (newer version already failed): <name>==<version> — these are older versions that were auto-skipped because a newer version of the same package already failedA package is considered failed if it failed or was skipped on ANY platform (linux-amd64, linux-arm64, macos).
packages.iniIn one pass:
Remove all packages that succeeded on all platforms — delete their entire section ([name==version] header + all config lines). The format-packages-ini pre-commit hook uses configparser which strips # comments, so commenting out doesn't work. Just delete succeeded sections outright. They don't need to rebuild.
Add python_versions = <MAJOR.MINOR to each failed package's section. Do NOT add # comments above — configparser strips them and can cause the python_versions line to be lost during formatting.
Do NOT modify packages that already have a python_versions restriction that is stricter than or equal to the new version (e.g., if a package already has python_versions = <3.13, leave it alone).
PYTHON-MAJOR-MINOR-UPGRADE.mdAfter parsing logs, create a file named PYTHON-MAJOR.MINOR-UPGRADE.md (e.g., PYTHON-3.14-UPGRADE.md) in the repo root with a detailed summary of all packages that failed to build. This serves as a reference for fixing build issues. The file should contain:
Example structure:
# Python 3.14 Upgrade — Build Failures
## Summary by category
| Category | Count | Packages |
|----------|-------|----------|
| pyo3 too old | 5 | pkg1, pkg2, ... |
| Cython incompatibility | 3 | pkg3, pkg4, ... |
## Detailed failures
### pkg1==1.2.3
- **Platforms**: all
- **Category**: pyo3 too old
- **Error**: pyo3 0.22.2 only supports up to Python 3.13
Commit with a message like "mark python 3.14 build failures in packages.ini" and push.
Wait for CI again. If there are still failures, repeat steps 3-6 until CI is green.
After CI is green, restore all previously-succeeded packages that were deleted in step 4. These packages don't need to rebuild (their existing wheels are fine), but they must remain in packages.ini so future builds include them.
Use a script to find sections present in the pre-deletion commit but missing from the current file:
import configparser, subprocess
old_content = subprocess.check_output(['git', 'show', '<pre-deletion-commit>:packages.ini']).decode()
old = configparser.RawConfigParser(strict=False)
old.read_string(old_content)
with open('packages.ini') as f:
cur = configparser.RawConfigParser(strict=False)
cur.read_string(f.read())
missing = set(old.sections()) - set(cur.sections())
# Exclude any packages intentionally not restored
# Append missing sections to packages.ini
with open('packages.ini', 'a') as f:
for section in sorted(missing):
f.write(f'\n[{section}]\n')
for k, v in old[section].items():
v = v.strip()
if '\n' in v:
f.write(f'{k} =\n')
for part in v.split('\n'):
if part.strip():
f.write(f' {part.strip()}\n')
else:
f.write(f'{k} = {v}\n')
Then run python3 -m format_ini packages.ini to sort and format. The formatter handles ordering automatically.
Commit and push. Verify CI passes — all packages should either download pre-built wheels or build successfully.
After all packages are restored and CI passes, revert the single-version mode changes from step 1 to build all Python versions again:
build.py: Change PYTHONS back to all versions (e.g., ((3, 11), (3, 12), (3, 13), (3, 14)))validate.py: Same change to PYTHONSdocker/install-pythons: Change VERSIONS back to all versions (e.g., ("3.11.14", "3.12.12", "3.13.12", "3.14.3"))docker/Dockerfile: Restore all cpython paths in PATH env var.github/workflows/build.yml:
image job entirelyneeds: [image] from the linux joblinux container back to :latest tag (from :${{ github.sha }})--upgrade-python flag from both linux and macos build commandsCommit with a message like "revert single-version mode, build all python versions" and push. Verify CI passes with all Python versions building.
--upgrade-python flag in build.py enables continue-on-failure mode with a 10-minute timeout per package. Without it, builds fail on first error (normal behavior).=== name==version@python, !!! FAILED: name==version: error, and !!! SKIPPED (newer version already failed): name==version log lines are the markers used to parse results.--upgrade-python mode, packages are sorted newest-version-first within each name. If the newest version fails, all older versions are automatically skipped.# — the format-packages-ini pre-commit hook uses Python's configparser which strips all # comments. Instead, delete succeeded sections entirely.format-packages-ini hook also sorts and reformats packages.ini, so ordering is handled automatically.