From 51c555a9d38dcfc2773a057f5b4193eac17a5461 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 11:27:01 -0500 Subject: [PATCH 1/9] removed curl install from Rocky build where curl was already installed --- .github/workflows/simple-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index dc13d3e..be77562 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -135,7 +135,7 @@ jobs: - name: Install system dependencies run: | dnf update -y - dnf install -y curl git gcc gcc-c++ make + dnf install -y git gcc gcc-c++ make - name: Checkout code uses: actions/checkout@v4 -- 2.47.3 From 89db9838b204782bfdca6c08ec9d22c91edf5a1b Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 11:35:47 -0500 Subject: [PATCH 2/9] changing Debian container to python3.12 --- .github/workflows/simple-release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index be77562..2b53628 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -39,7 +39,7 @@ jobs: build-debian: runs-on: ubuntu-latest container: - image: debian:12-slim + image: python:3.12-slim steps: - name: Install system dependencies run: | @@ -56,7 +56,7 @@ jobs: - name: Install Poetry run: | - curl -sSL https://install.python-poetry.org | python3.12 - + curl -sSL https://install.python-poetry.org | python - echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV - name: Configure Poetry @@ -68,7 +68,7 @@ jobs: - name: Install dependencies run: | export PATH="$HOME/.local/bin:$PATH" - poetry env use python3.12 + poetry env use python3.12 || true poetry install - name: Build Debian executable @@ -90,7 +90,7 @@ jobs: - name: Install system dependencies run: | pacman -Syu --noconfirm - pacman -S --noconfirm git base-devel curl + pacman -S --noconfirm python python-pip curl git base-devel - name: Checkout code uses: actions/checkout@v4 @@ -135,7 +135,7 @@ jobs: - name: Install system dependencies run: | dnf update -y - dnf install -y git gcc gcc-c++ make + dnf install -y curl git gcc gcc-c++ make - name: Checkout code uses: actions/checkout@v4 @@ -147,7 +147,7 @@ jobs: - name: Install Poetry run: | - curl -sSL https://install.python-poetry.org | python3.12 - + curl -sSL https://install.python-poetry.org | python - echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV - name: Configure Poetry @@ -159,7 +159,7 @@ jobs: - name: Install dependencies run: | export PATH="$HOME/.local/bin:$PATH" - poetry env use python3.12 + poetry env use python3.12 || true poetry install - name: Build Rocky executable -- 2.47.3 From 006669636f84ccfef09476ded916169985fa7d58 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 11:51:52 -0500 Subject: [PATCH 3/9] removed curl as method to install poetry and used action instead --- .github/workflows/simple-release.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 2b53628..e98beb7 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -132,10 +132,11 @@ jobs: container: image: rockylinux:9 steps: - - name: Install system dependencies + - name: Install system dependencies (avoid curl to prevent curl-minimal conflict) run: | - dnf update -y - dnf install -y curl git gcc gcc-c++ make + dnf -y update + # omit installing curl to avoid conflicts with curl-minimal + dnf -y install git gcc gcc-c++ make - name: Checkout code uses: actions/checkout@v4 @@ -146,12 +147,15 @@ jobs: python-version: '3.12' - name: Install Poetry - run: | - curl -sSL https://install.python-poetry.org | python - - echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV + uses: snok/install-poetry@v1 + with: + version: latest + virtualenvs-create: true + virtualenvs-in-project: true - name: Configure Poetry run: | + echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV export PATH="$HOME/.local/bin:$PATH" poetry config virtualenvs.create true poetry config virtualenvs.in-project true -- 2.47.3 From f834d96cf48cd7aa242e40f6154996300501db76 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 12:10:02 -0500 Subject: [PATCH 4/9] changed Rocky build flow to build Python from source --- .github/workflows/simple-release.yml | 45 ++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index e98beb7..90ab728 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -132,21 +132,47 @@ jobs: container: image: rockylinux:9 steps: - - name: Install system dependencies (avoid curl to prevent curl-minimal conflict) + - name: Install system build dependencies for Python and pyenv run: | + # update metadata and install packages required to build CPython from source dnf -y update - # omit installing curl to avoid conflicts with curl-minimal - dnf -y install git gcc gcc-c++ make + dnf -y install git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ + readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: '3.12' + - name: Install pyenv and build Python 3.12.11 (native to Rocky) + env: + PYENV_ROOT: ${{ github.workspace }}/.pyenv_temp + run: | + # Use $HOME/.pyenv so we don't touch repository files; we will record the path via GITHUB_ENV + export PYENV_ROOT="$HOME/.pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" - - name: Install Poetry + # Clone pyenv and python-build plugin + git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT" + git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" + + # Persist pyenv environment for subsequent steps + echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV + # prepend shims/bin to PATH so pyenv shims are available in later steps + echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV + + # Provide basic pyenv init for this step so we can run the pyenv binary immediately + export PYENV_ROOT="$HOME/.pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + eval "$($PYENV_ROOT/bin/pyenv init -)" + + # Build and install specific Python version (specify the exact patch for reproducibility) + $PYENV_ROOT/bin/pyenv install -v 3.12.11 + $PYENV_ROOT/bin/pyenv global 3.12.11 + + # Verify installed python + python --version + pip --version + + - name: Install Poetry (use action; Poetry will use the pyenv-built python) uses: snok/install-poetry@v1 with: version: latest @@ -163,7 +189,8 @@ jobs: - name: Install dependencies run: | export PATH="$HOME/.local/bin:$PATH" - poetry env use python3.12 || true + # ensure poetry uses the pyenv python + poetry env use 3.12.11 || true poetry install - name: Build Rocky executable -- 2.47.3 From 28afda6c1550e7a8c61ca5191c177b5bcec6b28e Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 12:15:18 -0500 Subject: [PATCH 5/9] enable the CodeReady Builder (CRB) repository so -devel packages (like gdbm-devel) are available --- .github/workflows/simple-release.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 90ab728..d41bf7c 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -132,9 +132,13 @@ jobs: container: image: rockylinux:9 steps: - - name: Install system build dependencies for Python and pyenv + - name: Install system build dependencies for Python and pyenv (enable CRB for -devel packages) run: | - # update metadata and install packages required to build CPython from source + # enable the CodeReady Builder (CRB) repository so -devel packages (like gdbm-devel) are available + dnf -y install dnf-plugins-core + dnf config-manager --set-enabled crb + + # Refresh metadata and install the packages required to build CPython from source dnf -y update dnf -y install git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch @@ -146,7 +150,7 @@ jobs: env: PYENV_ROOT: ${{ github.workspace }}/.pyenv_temp run: | - # Use $HOME/.pyenv so we don't touch repository files; we will record the path via GITHUB_ENV + # Use $HOME/.pyenv so we don't touch repository files export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" @@ -156,15 +160,14 @@ jobs: # Persist pyenv environment for subsequent steps echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV - # prepend shims/bin to PATH so pyenv shims are available in later steps echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV - # Provide basic pyenv init for this step so we can run the pyenv binary immediately + # Initialize pyenv for this step export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" eval "$($PYENV_ROOT/bin/pyenv init -)" - # Build and install specific Python version (specify the exact patch for reproducibility) + # Build and install specific Python version (specify exact patch for reproducibility) $PYENV_ROOT/bin/pyenv install -v 3.12.11 $PYENV_ROOT/bin/pyenv global 3.12.11 -- 2.47.3 From bbaffb9f0052e460540802f363033b6281115d11 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 12:21:11 -0500 Subject: [PATCH 6/9] made Rocky operations idempotent --- .github/workflows/simple-release.yml | 37 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index d41bf7c..b8912a1 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -146,29 +146,48 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Install pyenv and build Python 3.12.11 (native to Rocky) + - name: Install pyenv and build Python 3.12.11 (native to Rocky) — idempotent env: PYENV_ROOT: ${{ github.workspace }}/.pyenv_temp run: | - # Use $HOME/.pyenv so we don't touch repository files + # Use $HOME/.pyenv for the pyenv installation (runtime only — this will NOT change your repo files) export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" - # Clone pyenv and python-build plugin - git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT" - git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" + # Clone or update pyenv (idempotent) + if [ -d "$PYENV_ROOT/.git" ]; then + echo "pyenv already exists — updating" + cd "$PYENV_ROOT" + git fetch --all --prune + git reset --hard origin/master || true + cd - + else + echo "Cloning pyenv" + git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT" + fi + + # Clone or update python-build plugin (idempotent) + if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then + echo "python-build plugin already exists — updating" + cd "$PYENV_ROOT/plugins/python-build" + git fetch --all --prune + git reset --hard origin/master || true + cd - + else + echo "Cloning python-build plugin" + git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" + fi # Persist pyenv environment for subsequent steps echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV - # Initialize pyenv for this step - export PYENV_ROOT="$HOME/.pyenv" + # Initialize pyenv for this step and ensure pyenv is usable immediately export PATH="$PYENV_ROOT/bin:$PATH" eval "$($PYENV_ROOT/bin/pyenv init -)" - # Build and install specific Python version (specify exact patch for reproducibility) - $PYENV_ROOT/bin/pyenv install -v 3.12.11 + # Install the specified Python version if not already installed (-s = skip if present) + $PYENV_ROOT/bin/pyenv install -s 3.12.11 $PYENV_ROOT/bin/pyenv global 3.12.11 # Verify installed python -- 2.47.3 From e477f339d533cf5305246eb159b771acb8c3dc70 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 12:25:13 -0500 Subject: [PATCH 7/9] Removed duplicate pyenv install --- .github/workflows/simple-release.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index b8912a1..7610b29 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -166,18 +166,6 @@ jobs: git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT" fi - # Clone or update python-build plugin (idempotent) - if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then - echo "python-build plugin already exists — updating" - cd "$PYENV_ROOT/plugins/python-build" - git fetch --all --prune - git reset --hard origin/master || true - cd - - else - echo "Cloning python-build plugin" - git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" - fi - # Persist pyenv environment for subsequent steps echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV -- 2.47.3 From 7aefea8ba84fa101d2c3fd91f997565da2dad200 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 12:32:44 -0500 Subject: [PATCH 8/9] fixed adding Poetry to Windows path --- .github/workflows/simple-release.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 7610b29..10bf48a 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -22,6 +22,18 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true + - name: Ensure Poetry is on PATH (Windows) + shell: pwsh + run: | + # Add the typical Poetry installer location to PATH for subsequent steps. + # This writes the directory to GITHUB_PATH so it is appended to PATH automatically. + $poetryPath = Join-Path $env:USERPROFILE ".local\bin" + Write-Output "Adding $poetryPath to PATH via GITHUB_PATH" + Write-Output $poetryPath >> $Env:GITHUB_PATH + # Confirm it's on PATH for this step (diagnostics only) + Write-Output "PATH is now: $env:PATH" + Get-Command -ErrorAction SilentlyContinue poetry | ForEach-Object { Write-Output "poetry location: $($_.Source)" } || Write-Output "poetry not found yet (will be available in subsequent steps)" + - name: Install dependencies run: | poetry install @@ -166,6 +178,18 @@ jobs: git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT" fi + # Clone or update python-build plugin (idempotent) + if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then + echo "python-build plugin already exists — updating" + cd "$PYENV_ROOT/plugins/python-build" + git fetch --all --prune + git reset --hard origin/master || true + cd - + else + echo "Cloning python-build plugin" + git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" + fi + # Persist pyenv environment for subsequent steps echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV -- 2.47.3 From 642a9587ea3ceca85c8e4362c460260a2372a61e Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 12:37:17 -0500 Subject: [PATCH 9/9] Deleted the duplicate Pyenv install that Copilot added --- .github/workflows/simple-release.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 10bf48a..bcd3ca2 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -178,18 +178,6 @@ jobs: git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT" fi - # Clone or update python-build plugin (idempotent) - if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then - echo "python-build plugin already exists — updating" - cd "$PYENV_ROOT/plugins/python-build" - git fetch --all --prune - git reset --hard origin/master || true - cd - - else - echo "Cloning python-build plugin" - git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" - fi - # Persist pyenv environment for subsequent steps echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV -- 2.47.3