From 8a55804b7a3efec347356c3513897605fb91df9a Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 24 Apr 2024 17:57:04 -0500 Subject: [PATCH] feat: Use pipx to run id * Requires id v1.4.0+ --- ...if cookiecutter.__ci=='gitlab' %}.gitlab-ci.yml{% endif %} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/{% if cookiecutter.__ci=='gitlab' %}.gitlab-ci.yml{% endif %} b/{{cookiecutter.project_name}}/{% if cookiecutter.__ci=='gitlab' %}.gitlab-ci.yml{% endif %} index 3d6fea47..a1fe0423 100644 --- a/{{cookiecutter.project_name}}/{% if cookiecutter.__ci=='gitlab' %}.gitlab-ci.yml{% endif %} +++ b/{{cookiecutter.project_name}}/{% if cookiecutter.__ci=='gitlab' %}.gitlab-ci.yml{% endif %} @@ -21,7 +21,7 @@ before_script: - python -V - python -m venv .venv - source .venv/bin/activate - - python -m pip install -U pip pipx id + - python -m pip install -U pip pipx - python -m pipx ensurepath - python -m pip freeze @@ -153,7 +153,7 @@ make_wheels: {%- endif %} script: # Retrieve the OIDC token from GitLab CI/CD and exchange it for a PyPI API token - - oidc_token=$(python -m id PYPI) + - oidc_token=$(pipx run id PYPI) - response=$(curl -X POST "${OIDC_MINT_TOKEN_URL}" -d "{\"token\":\"${oidc_token}\"}") - api_token=$(jq --raw-output '.token' <<< "${response}")