DSPy: The framework for programming—not prompting—language models
Python
fix(ci): repair publisher container CA trust (#10711)
Isaac Miller98830391be6f
diff --git a/.github/actions/pypi-publish/Dockerfile b/.github/actions/pypi-publish/Dockerfilenew file mode 100644index 000000000..58da67c86--- /dev/null+++ b/.github/actions/pypi-publish/Dockerfile@@ -0,0 +1,18 @@+# Temporary eMudhra remediation: remove this overlay once upstream ships+# certifi>=2026.10.19, sigstore>=4.5.1, pip>=26.2.2 in both installation sites,+# and an OS trust store without emSign ECC Root CA - G3.+# Upstream v1.14.3 (7245906fb61fa33a13554f9d5fb856fe61758086), linux/amd64.+FROM ghcr.io/pypa/gh-action-pypi-publish@sha256:411241df99067c98b6d08fd8e26d14e86740a22460599c2af571e6dc26e27ffc++# The upstream image also predates the OS trust-store update. Distrust only the+# compromised root, preserving the unaffected emSign roots.+RUN sed -i 's|^mozilla/emSign_ECC_Root_CA_-_G3.crt$|!mozilla/emSign_ECC_Root_CA_-_G3.crt|' /etc/ca-certificates.conf \+ && update-ca-certificates --fresh++# Verify the exact wheel before either offline installation. Isolated mode+# bypasses upstream's user-site PYTHONPATH when upgrading the global copy.+RUN python -c "import urllib.request; urllib.request.urlretrieve('https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl', '/tmp/pip-26.2.2-py3-none-any.whl')" \+ && echo 'fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70 /tmp/pip-26.2.2-py3-none-any.whl' | sha256sum --check --strict \+ && python -m pip install --user --no-index --no-deps /tmp/pip-26.2.2-py3-none-any.whl \+ && python -I -m pip install --no-index --no-deps /tmp/pip-26.2.2-py3-none-any.whl \+ && rm /tmp/pip-26.2.2-py3-none-any.whldiff --git a/.github/actions/pypi-publish/action.yml b/.github/actions/pypi-publish/action.ymlnew file mode 100644index 000000000..a90443f6c--- /dev/null+++ b/.github/actions/pypi-publish/action.yml@@ -0,0 +1,32 @@+name: Publish Python distributions (temporary patched upstream)+description: Upstream PyPA publisher with a temporary pip security overlay.+inputs:+ user:+ description: PyPI user+ default: __token__+ password:+ description: API token (omit for Trusted Publishing)+ repository-url:+ description: Package index upload URL+ default: https://upload.pypi.org/legacy/+ packages-dir:+ description: Directory containing distributions+ default: dist+ verify-metadata:+ description: Check metadata before uploading+ default: 'true'+ skip-existing:+ description: Skip distributions already present on the index+ default: 'false'+ verbose:+ description: Show verbose output+ default: 'true'+ print-hash:+ description: Show distribution hashes+ default: 'true'+ attestations:+ description: Generate PEP 740 attestations with Trusted Publishing+ default: 'true'+runs:+ using: docker+ image: Dockerfilediff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.ymlindex a1c4a13a5..efa0aee87 100644--- a/.github/workflows/build_and_release.yml+++ b/.github/workflows/build_and_release.yml@@ -78,7 +78,7 @@ jobs:deactivate# Publish to test-PyPI- name: Publish distribution 📦 to test-PyPI- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 # This requires a trusted publisher to be setup in pypi/testpypi+ uses: ./.github/actions/pypi-publish # zizmor: ignore[self-repository] actionlint does not yet support $/ pathswith:repository-url: https://test.pypi.org/legacy/@@ -147,7 +147,7 @@ jobs:path: dist/*.whlif-no-files-found: error- name: Publish distribution 📦 to PyPI (dspy)- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3+ uses: ./.github/actions/pypi-publish # zizmor: ignore[self-repository] actionlint does not yet support $/ pathswith:attestations: false# Publish to dspy-ai@@ -166,7 +166,7 @@ jobs:- name: Validate built distributions (dspy-ai)run: python3 -m twine check --strict .github/.internal_dspyai/dist/*- name: Publish distribution 📦 to PyPI (dspy-ai)- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3+ uses: ./.github/actions/pypi-publish # zizmor: ignore[self-repository] actionlint does not yet support $/ pathswith:attestations: falsepackages-dir: .github/.internal_dspyai/dist/