Skip to content

Commit

Permalink
Add Python version to workflows in package and template
Browse files Browse the repository at this point in the history
Add python-version: 3.11 to workflows.
Use a hack to manage setup-python looking for requirements.txt.

Refs: actions/setup-python#807

Closes #448
  • Loading branch information
abelsiqueira committed Sep 17, 2024
1 parent f807918 commit 8ad8388
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ jobs:
uses: julia-actions/cache@v2
- name: Install JuliaFormatter.jl
run: julia -e 'using Pkg; pkg"add JuliaFormatter"'
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: touch requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: "pip"
python-version: "3.11"
- name: Un-Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: rm requirements.txt
- name: Cache pre-commit
uses: actions/cache@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/PreCommitUpdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: touch requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: pip
python-version: "3.11"
- name: Un-Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: rm requirements.txt
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit's autoupdate
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ReusableTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,15 @@ jobs:
arch: ${{ inputs.arch }}
- name: Use Julia cache
uses: julia-actions/cache@v2
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: touch requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: "pip"
python-version: "3.11"
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: rm requirements.txt
- name: Cache pre-commit
uses: actions/cache@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/TestGeneratedPkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ jobs:
uses: julia-actions/julia-buildpkg@v1
- name: Install JuliaFormatter.jl
run: julia -e 'using Pkg; pkg"add JuliaFormatter"'
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: touch requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: "pip"
python-version: "3.11"
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: rm requirements.txt
- name: Cache pre-commit
uses: actions/cache@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions template/.github/workflows/Lint.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ jobs:
uses: julia-actions/cache@v2
- name: Install JuliaFormatter.jl
run: julia -e 'using Pkg; pkg"add JuliaFormatter"'
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: touch requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: "pip"
python-version: "3.11"
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: rm requirements.txt
- name: Cache pre-commit
uses: actions/cache@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ jobs:
uses: julia-actions/cache@v2
- name: Install JuliaFormatter.jl
run: julia -e 'using Pkg; pkg"add JuliaFormatter"'
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: touch requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: "3.11"
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: rm requirements.txt
- name: Check for update in the template
run: |
pip install copier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: touch requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: pip
python-version: "3.11"
- name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807
run: rm requirements.txt
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit's autoupdate
Expand Down

0 comments on commit 8ad8388

Please sign in to comment.