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 09781f4
Showing 1 changed file with 43 additions and 5 deletions.
48 changes: 43 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ 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:
- free-threaded: true
architecture: "x64"
python-version: "3.13"


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 +40,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/python-3.13-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 +89,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:
- free-threaded: true
python-version: "3.13"

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 +108,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/python-3.13-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 +174,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 +192,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 09781f4

Please sign in to comment.