Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workflows): enable Python 3.12 build #216

Merged
merged 3 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ install:
install-editable:
$(PYTHON) -m pip install --upgrade pip
$(PYTHON) -m pip install --upgrade setuptools wheel
$(PYTHON) -m pip install torch numpy pybind11 cmake
$(PYTHON) -m pip install --upgrade pybind11 cmake
$(PYTHON) -m pip install torch numpy
USE_FP16=ON TORCH_CUDA_ARCH_LIST=Auto $(PYTHON) -m pip install -vvv --no-build-isolation --editable .

install-e: install-editable # alias
Expand Down Expand Up @@ -114,7 +115,7 @@ addlicense-install: go-install
pytest: test-install
$(PYTHON) -m pytest --version
cd tests && $(PYTHON) -c 'import $(PROJECT_PATH)' && \
$(PYTHON) -m pytest --verbose --color=yes --durations=0 \
$(PYTHON) -m pytest --verbose --color=yes \
--cov="$(PROJECT_PATH)" --cov-config=.coveragerc --cov-report=xml --cov-report=term-missing \
$(PYTESTOPTS) .

Expand Down
7 changes: 5 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 Expand Up @@ -314,6 +316,7 @@ filterwarnings = [
"error",
'ignore:Explicitly requested dtype float64 requested in .* is not available, and will be truncated to dtype float32\.:UserWarning',
'ignore:jax\.numpy\.DeviceArray is deprecated\. Use jax\.Array\.:DeprecationWarning',
'ignore:(ast\.Str|ast\.NameConstant|Attribute s) is deprecated and will be removed in Python 3\.14:DeprecationWarning',
'ignore:.*functorch.*deprecate.*:UserWarning',
'ignore:.*Apple Paravirtual device.*:UserWarning',
'ignore:.*NVML.*:UserWarning',
Expand Down
Loading