Skip to content

Commit

Permalink
feat(workflows): enable Python 3.12 build
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed May 10, 2024
1 parent 190ca72 commit 3c88ab7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8 - 3.11" # sync with requires-python in pyproject.toml
python-version: "3.8 - 3.12" # sync with requires-python in pyproject.toml
update-environment: true

- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel build

- name: Set __release__
if: |
startsWith(github.ref, 'refs/tags/') ||
Expand All @@ -69,9 +72,6 @@ jobs:
- name: Print version
run: python setup.py --version

- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel build

- name: Build sdist and pure-Python wheel
run: python -m build
env:
Expand Down Expand Up @@ -120,6 +120,9 @@ jobs:
python-version: ${{ matrix.python-version }}
update-environment: true

- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel build

- name: Set __release__
if: |
startsWith(github.ref, 'refs/tags/') ||
Expand Down Expand Up @@ -155,7 +158,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11"] # sync with requires-python in pyproject.toml
python-version: ["3.9", "3.10", "3.11", "3.12"] # sync with requires-python in pyproject.toml
fail-fast: false
timeout-minutes: 60
steps:
Expand All @@ -171,6 +174,9 @@ jobs:
python-version: ${{ matrix.python-version }}
update-environment: true

- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel build

- name: Set __release__
if: |
startsWith(github.ref, 'refs/tags/') ||
Expand Down Expand Up @@ -249,9 +255,12 @@ jobs:
uses: actions/setup-python@v5
if: startsWith(github.ref, 'refs/tags/')
with:
python-version: "3.8 - 3.11" # sync with requires-python in pyproject.toml
python-version: "3.8 - 3.12" # sync with requires-python in pyproject.toml
update-environment: true

- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel build

- name: Set __release__
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
run: |
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

-
- Enable CI workflow to build CXX/CUDA extension for Python 3.12 by [@XuehaiPan](https://github.com/XuehaiPan) in [#216](https://github.com/metaopt/torchopt/pull/216).

### Changed

Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ authors = [
license = { text = "Apache License, Version 2.0" }
keywords = [
"PyTorch",
"functorch",
"FuncTorch",
"JAX",
"Meta-Learning",
"Optimizer",
Expand All @@ -38,6 +38,8 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
Expand Down Expand Up @@ -179,7 +181,7 @@ test-command = """
line-length = 100
skip-string-normalization = true
# Sync with requires-python
target-version = ["py38", "py39", "py310", "py311"]
target-version = ["py38"]

[tool.isort]
atomic = true
Expand Down

0 comments on commit 3c88ab7

Please sign in to comment.