From f5f725065bf2fb056ebc4fcfb3efa04a7489bb40 Mon Sep 17 00:00:00 2001 From: Jake VanCampen Date: Fri, 16 Feb 2024 13:44:28 -0800 Subject: [PATCH] fix: python version order and CI scaffold (#9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - python version as env var in CI, and in scaffolds - escaped in templates so jinja can rendr --------- Co-authored-by: Johannes Köster --- .github/workflows/release-please.yml | 11 +++++++---- .github/workflows/test.yml | 17 ++++++++++------- poetry_snakemake_plugin/templates/ci.yml.j2 | 15 +++++++++------ .../templates/release_please.yml.j2 | 7 +++++-- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 27f441a..0521763 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -5,6 +5,9 @@ on: name: release-please +env: + PYTHON_VERSION: 3.11 + jobs: release-please: runs-on: ubuntu-latest @@ -24,19 +27,19 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: ${{ env.PYTHON_VERSION }} - name: Install poetry - run: pipx install poetry + run: pip install poetry - name: Determine dependencies run: poetry lock - uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: ${{ env.PYTHON_VERSION }} cache: poetry - name: Install Dependencies using Poetry diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ca5a44..9eb9423 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,9 @@ on: - main pull_request: +env: + PYTHON_VERSION: 3.11 + jobs: formatting: runs-on: ubuntu-latest @@ -15,8 +18,8 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" - + python-version: ${{ env.PYTHON_VERSION }} + - name: Install poetry run: pip install poetry @@ -25,7 +28,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: ${{ env.PYTHON_VERSION }} cache: poetry - name: Install Dependencies using Poetry @@ -42,7 +45,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: ${{ env.PYTHON_VERSION }} - name: Install poetry run: pip install poetry @@ -52,7 +55,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: ${{ env.PYTHON_VERSION }} cache: poetry - name: Install Dependencies using Poetry @@ -68,7 +71,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: ${{ env.PYTHON_VERSION }} - name: Install poetry run: pip install poetry @@ -78,7 +81,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: ${{ env.PYTHON_VERSION }} cache: poetry - name: Install dependencies diff --git a/poetry_snakemake_plugin/templates/ci.yml.j2 b/poetry_snakemake_plugin/templates/ci.yml.j2 index f307fb8..f48154f 100644 --- a/poetry_snakemake_plugin/templates/ci.yml.j2 +++ b/poetry_snakemake_plugin/templates/ci.yml.j2 @@ -6,6 +6,9 @@ on: - main pull_request: +env: + PYTHON_VERSION: 3.11 + jobs: formatting: runs-on: ubuntu-latest @@ -15,7 +18,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: {{ "${{ env.PYTHON_VERSION }}" }} - name: Install poetry run: pip install poetry @@ -25,7 +28,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: {{ "${{ env.PYTHON_VERSION }}" }} cache: poetry - name: Install Dependencies using Poetry @@ -42,7 +45,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: {{ "${{ env.PYTHON_VERSION }}" }} - name: Install poetry run: pip install poetry @@ -52,7 +55,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: {{ "${{ env.PYTHON_VERSION }}" }} cache: poetry - name: Install Dependencies using Poetry @@ -68,7 +71,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: {{ "${{ env.PYTHON_VERSION }}" }} - name: Install poetry run: pip install poetry @@ -78,7 +81,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: {{ "${{ env.PYTHON_VERSION }}" }} cache: poetry - name: Install dependencies diff --git a/poetry_snakemake_plugin/templates/release_please.yml.j2 b/poetry_snakemake_plugin/templates/release_please.yml.j2 index d001fe4..b89a0f5 100644 --- a/poetry_snakemake_plugin/templates/release_please.yml.j2 +++ b/poetry_snakemake_plugin/templates/release_please.yml.j2 @@ -5,6 +5,9 @@ on: name: release-please +env: + PYTHON_VERSION: 3.11 + jobs: release-please: runs-on: ubuntu-latest @@ -26,7 +29,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: {{ "${{ env.PYTHON_VERSION }}" }} - name: Install poetry run: pip install poetry @@ -36,7 +39,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: {{ "${{ env.PYTHON_VERSION }}" }} cache: poetry - name: Install Dependencies using Poetry