Skip to content

Commit cfa35ae

Browse files
authored
Fix gh actions use of Python version (#13)
1 parent e60d2ad commit cfa35ae

File tree

6 files changed

+84
-8
lines changed

6 files changed

+84
-8
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- uses: actions/checkout@v4
19+
- name: Remove Homebrew Python (macOS)
20+
if: runner.os == 'macOS'
21+
run: |
22+
# Liste alle installierten Python-Versionen von Homebrew auf
23+
brew list --formula | grep '^python@' | while read formula; do
24+
echo "Uninstalling $formula"
25+
brew uninstall --ignore-dependencies --force "$formula"
26+
done
27+
# Entferne auch unversioniertes python falls vorhanden
28+
if brew list python &>/dev/null; then
29+
brew uninstall --ignore-dependencies --force python
30+
fi
31+
# Entferne Symlinks in /usr/local/bin
32+
sudo rm -f /usr/local/bin/python* /usr/local/bin/pip* /usr/local/bin/2to3*
33+
shell: bash
1934
- name: Set up Python ${{ matrix.python-version }}
2035
uses: actions/setup-python@v5
2136
with:
@@ -24,9 +39,11 @@ jobs:
2439
uses: astral-sh/setup-uv@v4
2540
with:
2641
enable-cache: true
27-
cache-dependency-path: |
42+
cache-dependency-glob: |
2843
pyproject.toml
2944
uv.lock
45+
- name: Pin Python version for uv
46+
run: uv python pin ${{ matrix.python-version }}
3047
- name: Check Python and uv
3148
run: |
3249
uv run python -V

.github/workflows/test-get-platformio-no-uv.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,25 @@ jobs:
2222
pip uninstall -y uv || true
2323
if python -m uv --version 2>/dev/null; then exit 1; fi
2424
shell: bash
25+
- name: Remove Homebrew Python (macOS)
26+
if: runner.os == 'macOS'
27+
run: |
28+
# Liste alle installierten Python-Versionen von Homebrew auf
29+
brew list --formula | grep '^python@' | while read formula; do
30+
echo "Uninstalling $formula"
31+
brew uninstall --ignore-dependencies --force "$formula"
32+
done
33+
# Entferne auch unversioniertes python falls vorhanden
34+
if brew list python &>/dev/null; then
35+
brew uninstall --ignore-dependencies --force python
36+
fi
37+
# Entferne Symlinks in /usr/local/bin
38+
sudo rm -f /usr/local/bin/python* /usr/local/bin/pip* /usr/local/bin/2to3*
39+
shell: bash
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: ${{ matrix.python-version }}
2544
- name: Run get-platformio.py
2645
run: |
2746
python get-platformio.py

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

get-platformio.py

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ classifiers = [
2525
"Topic :: Software Development :: Embedded Systems",
2626
"Topic :: System :: Installation/Setup",
2727
]
28-
requires-python = ">=3.10"
28+
requires-python = ">=3.9"
2929
dependencies = [
3030
"click>=8.1.0",
3131
"requests>=2.32,<3",

uv.lock

Lines changed: 44 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)