Skip to content

Commit

Permalink
Remove setup-python action, let uv install the right version
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Dec 24, 2024
1 parent 64280f6 commit fc63874
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 258 deletions.
116 changes: 0 additions & 116 deletions .github/workflows/autofix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,42 +50,6 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
# We're going to browse all new commits.
fetch-depth: 0
- name: Hack setup-python cache
id: setup_python_hack
# XXX Create an empty pyproject.toml if this file (or any *requirements.txt) can't be found in repository.
# This hack fix an issue with setup-python, which ends up with this error in non-Python repos:
#
# Run actions/[email protected]
# with:
# python-version: 3.13
# cache: pip
# cache-dependency-path: |
# **/pyproject.toml
# requirements/*.txt
# Installed versions
# Successfully set up CPython (3.13.1)
# Error: No file in /home/runner/work/awesome-iam/awesome-iam matched to
# [requirements/*.txt or **/pyproject.toml], make sure you have checked out the target repository
#
# This has been reported at: https://github.com/actions/setup-python/issues/807
# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762
# or https://github.com/actions/setup-python/issues/751
if: hashFiles('**/pyproject.toml', '*requirements.txt', 'requirements/*.txt') == ''
run: |
touch ./pyproject.toml
echo "tmp_deps_file=true" >> "$GITHUB_OUTPUT"
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Remove setup-python hack
if: steps.setup_python_hack.outputs.tmp_deps_file
run: |
rm ./pyproject.toml
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand All @@ -108,38 +72,6 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- name: Hack setup-python cache
id: setup_python_hack
# XXX Create an empty pyproject.toml if this file (or any *requirements.txt) can't be found in repository.
# This hack fix an issue with setup-python, which ends up with this error in non-Python repos:
#
# Run actions/[email protected]
# with:
# python-version: 3.13
# cache: pip
# cache-dependency-path: |
# **/pyproject.toml
# requirements/*.txt
# Installed versions
# Successfully set up CPython (3.13.1)
# Error: No file in /home/runner/work/awesome-iam/awesome-iam matched to
# [requirements/*.txt or **/pyproject.toml], make sure you have checked out the target repository
#
# This has been reported at: https://github.com/actions/setup-python/issues/807
# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762
# or https://github.com/actions/setup-python/issues/751
if: hashFiles('**/pyproject.toml', '*requirements.txt', 'requirements/*.txt') == ''
run: |
touch ./pyproject.toml
echo "tmp_deps_file=true" >> "$GITHUB_OUTPUT"
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down Expand Up @@ -222,10 +154,6 @@ jobs:
- name: Remove temporary Ruff config
run: |
rm ./ruff.toml
- name: Remove setup-python hack
if: steps.setup_python_hack.outputs.tmp_deps_file
run: |
rm ./pyproject.toml
- name: Run blacken-docs
# Ignore failing command: blacken-docs returns 1 if it finds a file that needs to be reformatted:
# https://github.com/adamchainz/blacken-docs/blob/79ef671/blacken_docs.py#L207-L211
Expand Down Expand Up @@ -265,14 +193,6 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down Expand Up @@ -302,42 +222,6 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- name: Hack setup-python cache
id: setup_python_hack
# XXX Create an empty pyproject.toml if this file (or any *requirements.txt) can't be found in repository.
# This hack fix an issue with setup-python, which ends up with this error in non-Python repos:
#
# Run actions/[email protected]
# with:
# python-version: 3.13
# cache: pip
# cache-dependency-path: |
# **/pyproject.toml
# requirements/*.txt
# Installed versions
# Successfully set up CPython (3.13.1)
# Error: No file in /home/runner/work/awesome-iam/awesome-iam matched to
# [requirements/*.txt or **/pyproject.toml], make sure you have checked out the target repository
#
# This has been reported at: https://github.com/actions/setup-python/issues/807
# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762
# or https://github.com/actions/setup-python/issues/751
if: hashFiles('**/pyproject.toml', '*requirements.txt', 'requirements/*.txt') == ''
run: |
touch ./pyproject.toml
echo "tmp_deps_file=true" >> "$GITHUB_OUTPUT"
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Remove setup-python hack
if: steps.setup_python_hack.outputs.tmp_deps_file
run: |
rm ./pyproject.toml
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ jobs:
- major
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down Expand Up @@ -110,14 +102,6 @@ jobs:
# start to discuss this upstream.
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ jobs:
with:
# Fetch all history to extract all contributors.
fetch-depth: 0
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down Expand Up @@ -149,42 +141,6 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
# We're going to browse all new commits.
fetch-depth: 0
- name: Hack setup-python cache
id: setup_python_hack
# XXX Create an empty pyproject.toml if this file (or any *requirements.txt) can't be found in repository.
# This hack fix an issue with setup-python, which ends up with this error in non-Python repos:
#
# Run actions/[email protected]
# with:
# python-version: 3.13
# cache: pip
# cache-dependency-path: |
# **/pyproject.toml
# requirements/*.txt
# Installed versions
# Successfully set up CPython (3.13.1)
# Error: No file in /home/runner/work/awesome-iam/awesome-iam matched to
# [requirements/*.txt or **/pyproject.toml], make sure you have checked out the target repository
#
# This has been reported at: https://github.com/actions/setup-python/issues/807
# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762
# or https://github.com/actions/setup-python/issues/751
if: hashFiles('**/pyproject.toml', '*requirements.txt', 'requirements/*.txt') == ''
run: |
touch ./pyproject.toml
echo "tmp_deps_file=true" >> "$GITHUB_OUTPUT"
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Remove setup-python hack
if: steps.setup_python_hack.outputs.tmp_deps_file
run: |
rm ./pyproject.toml
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down
72 changes: 0 additions & 72 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,6 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
# We're going to browse all new commits.
fetch-depth: 0
- name: Hack setup-python cache
id: setup_python_hack
# XXX Create an empty pyproject.toml if this file (or any *requirements.txt) can't be found in repository.
# This hack fix an issue with setup-python, which ends up with this error in non-Python repos:
#
# Run actions/[email protected]
# with:
# python-version: 3.13
# cache: pip
# cache-dependency-path: |
# **/pyproject.toml
# requirements/*.txt
# Installed versions
# Successfully set up CPython (3.13.1)
# Error: No file in /home/runner/work/awesome-iam/awesome-iam matched to
# [requirements/*.txt or **/pyproject.toml], make sure you have checked out the target repository
#
# This has been reported at: https://github.com/actions/setup-python/issues/807
# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762
# or https://github.com/actions/setup-python/issues/751
if: hashFiles('**/pyproject.toml', '*requirements.txt', 'requirements/*.txt') == ''
run: |
touch ./pyproject.toml
echo "tmp_deps_file=true" >> "$GITHUB_OUTPUT"
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Remove setup-python hack
if: steps.setup_python_hack.outputs.tmp_deps_file
run: |
rm ./pyproject.toml
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down Expand Up @@ -111,42 +75,6 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- name: Hack setup-python cache
id: setup_python_hack
# XXX Create an empty pyproject.toml if this file (or any *requirements.txt) can't be found in repository.
# This hack fix an issue with setup-python, which ends up with this error in non-Python repos:
#
# Run actions/[email protected]
# with:
# python-version: 3.13
# cache: pip
# cache-dependency-path: |
# **/pyproject.toml
# requirements/*.txt
# Installed versions
# Successfully set up CPython (3.13.1)
# Error: No file in /home/runner/work/awesome-iam/awesome-iam matched to
# [requirements/*.txt or **/pyproject.toml], make sure you have checked out the target repository
#
# This has been reported at: https://github.com/actions/setup-python/issues/807
# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762
# or https://github.com/actions/setup-python/issues/751
if: hashFiles('**/pyproject.toml', '*requirements.txt', 'requirements/*.txt') == ''
run: |
touch ./pyproject.toml
echo "tmp_deps_file=true" >> "$GITHUB_OUTPUT"
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Remove setup-python hack
if: steps.setup_python_hack.outputs.tmp_deps_file
run: |
rm ./pyproject.toml
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ jobs:
- name: List all commits
run: |
git log --decorate=full --oneline
- uses: actions/[email protected]
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
*requirements.txt
requirements/*.txt
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
if: matrix.os == 'windows-2019'
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
python-version: "${{ matrix.python-version }}"
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/main/requirements/uv.txt
Expand Down
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
> [!IMPORTANT]
> This version is not released yet and is under active development.
- Use `uv` instead of GitHub action to install a specific version of Python. On all platforms but `windows-2019`.
- Use `uv` instead of `setup-python` action to install Python. On all platforms but `windows-2019`.
- Remove auto-generated dummy `pyproject.toml` used to hack `setup-python` caching.
- Run all jobs on Python 3.13.
- Move coverage configuration to pytest invocation.
- Do not let `uv sync` operation update the `uv.lock` file.
Expand Down

0 comments on commit fc63874

Please sign in to comment.