-
Notifications
You must be signed in to change notification settings - Fork 1
BUILD-12410 Export Repox index env vars from config-pip #339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,26 +7,41 @@ | |
| # - ARTIFACTORY_ACCESS_TOKEN: Access token to read Repox repositories | ||
| # | ||
| # GitHub Actions auto-provided: | ||
| # - GITHUB_REPOSITORY: Repository name in format "owner/repo" | ||
| # - GITHUB_ENV: Path to GitHub Actions environment file | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| : "${ARTIFACTORY_URL:?}" "${ARTIFACTORY_USERNAME:?}" "${ARTIFACTORY_ACCESS_TOKEN:?}" | ||
| : "${ARTIFACTORY_URL:?}" "${ARTIFACTORY_USERNAME:?}" "${ARTIFACTORY_ACCESS_TOKEN:?}" "${GITHUB_ENV:?}" | ||
|
|
||
| configure_pip() { | ||
| echo "Configuring pip to use Artifactory..." | ||
|
|
||
| # Extract the host from ARTIFACTORY_URL | ||
| local repox_host="${ARTIFACTORY_URL#https://}" | ||
| local repox_host pip_conf_file authenticated_index registry_url | ||
|
|
||
| repox_host="${ARTIFACTORY_URL#https://}" | ||
| repox_host="${repox_host#http://}" | ||
| echo "Repox host: $repox_host" | ||
|
|
||
| mkdir -p "$HOME/.pip" | ||
| cat > "${HOME}/.pip/pip.conf" <<EOF | ||
| pip_conf_file="${HOME}/.pip/pip.conf" | ||
| authenticated_index="https://${ARTIFACTORY_USERNAME}:${ARTIFACTORY_ACCESS_TOKEN}@${repox_host}/api/pypi/sonarsource-pypi/simple" | ||
| registry_url="${authenticated_index}/{}/" | ||
|
|
||
| mkdir -p "${HOME}/.pip" | ||
| cat > "$pip_conf_file" <<EOF | ||
| [global] | ||
| index-url = https://${ARTIFACTORY_USERNAME}:${ARTIFACTORY_ACCESS_TOKEN}@$repox_host/api/pypi/sonarsource-pypi/simple | ||
| index-url = ${authenticated_index} | ||
| EOF | ||
| echo "Configuration file: ${HOME}/.pip/pip.conf" | ||
| echo "Configuration file: ${pip_conf_file}" | ||
|
|
||
| echo "::add-mask::${authenticated_index}" | ||
| echo "::add-mask::${registry_url}" | ||
| { | ||
| echo "PIP_INDEX_URL=${authenticated_index}" | ||
| echo "UV_DEFAULT_INDEX=${authenticated_index}" | ||
| echo "MISE_PIPX_REGISTRY_URL=${registry_url}" | ||
| echo "PIP_CONFIG_FILE=${pip_conf_file}" | ||
| } >> "$GITHUB_ENV" | ||
|
Comment on lines
+38
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Quality: Repo's own mise workflows still resolve pipx tools from pypi.orgThe PR's test plan is to observe "Repox traffic and no pypi.org / files.pythonhosted.org" on this repo's mise workflows, but the only workflow that runs Run config-pip before mise-action in test-shell-scripts.yml (and the other mise-based test workflows) so pipx/mise resolve from Repox.: Was this helpful? React with 👍 / 👎 |
||
|
|
||
| return 0 | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MISE_PIPX_REGISTRY_URLis set to…/api/pypi/sonarsource-pypi/simple/{}/. In every released mise version (checked v2026.5.9, v2026.6.14, v2026.8.1 — the versions this repo pins inconfig-uv/action.yml:103and.github/workflows/test-shell-scripts.yml:25), aregistry_urlthat does not contain/jsonis fetched as HTML and versions are extracted with the regexhref=["'][^"']*/([^/]+)\.tar\.gz…(src/backend/pipx.rs:144-160 and :209-220). Only sdist links are recognised, so for any wheel-only package (no.tar.gzon the index)misegets an empty version list andmise install pipx:<pkg>/@latestresolution fails, where previously the pypi.org JSON API returned all versions. Wheel support for the simple index exists only on misemain(versions_from_simple_indexhandling.whl), not in a release. Either wait for/require a mise version with wheel support, or document the limitation and the requirement to pin sdist-publishing packages in the README note added at README.md:1218.Document the wheel-only limitation next to the new ordering note so consumers are not surprised by "no versions found" failures.:
Was this helpful? React with 👍 / 👎