Skip to content

Commit

Permalink
test free-threaded builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Oct 13, 2024
1 parent c6acaf5 commit c59795f
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
architecture: ["x64", "x86"]
free-threaded: [false]
include:
- python-version: "3.13"
architecture: "x64"
free-threaded: true

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
if: ${{ ! matrix.free-threaded }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -33,6 +39,19 @@ jobs:
cache-dependency-path: .github/workflows/main.yml
check-latest: true

# From https://py-free-threading.github.io/ci/#windows-ci-setup-via-custom-powershell
# Until either the following are available:
# https://github.com/actions/setup-python/issues/771
# https://github.com/astral-sh/uv/issues/7193
- name: Set up Python 3.13t
if: ${{ matrix.free-threaded }}
run: |
$pythonInstallerUrl = "https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe"
Invoke-WebRequest $pythonInstallerUrl -OutFile setup-python.exe
Start-Process "setup-python.exe" -argumentlist "/quiet PrependPath=1 TargetDir=C:\Python313 Include_freethreaded=1" -wait
C:\Python313\python3.13t.exe -m pip install -r requirements.txt
C:\Python313\python3.13t.exe -c "import sys; print(sys._is_gil_enabled())"
- name: Setup environment
run: |
python --version
Expand Down Expand Up @@ -69,11 +88,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13-dev"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
free-threaded: [false]
include:
- python-version: "3.13"
free-threaded: true

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
if: ${{ ! matrix.free-threaded }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -82,6 +107,19 @@ jobs:
cache-dependency-path: .github/workflows/main.yml
check-latest: true

# From https://py-free-threading.github.io/ci/#windows-ci-setup-via-custom-powershell
# Until either the following are available:
# https://github.com/actions/setup-python/issues/771
# https://github.com/astral-sh/uv/issues/7193
- name: Set up Python 3.13t
if: ${{ matrix.free-threaded }}
run: |
$pythonInstallerUrl = "https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe"
Invoke-WebRequest $pythonInstallerUrl -OutFile setup-python.exe
Start-Process "setup-python.exe" -argumentlist "/quiet PrependPath=1 TargetDir=C:\Python313 Include_freethreaded=1" -wait
C:\Python313\python3.13t.exe -m pip install -r requirements.txt
C:\Python313\python3.13t.exe -c "import sys; print(sys._is_gil_enabled())"
- name: Setup Environment
run: |
python --version
Expand Down Expand Up @@ -135,8 +173,7 @@ jobs:
fail-fast: false
matrix:
# mypy 1.5 dropped support for Python 3.7
# mypy won't understand "3.13-dev", keeping the CI simple by just omitting it
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -154,7 +191,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down

0 comments on commit c59795f

Please sign in to comment.