Skip to content
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
22 changes: 19 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7 - 3.11"
python-version: "3.7 - 3.12"
update-environment: true

- name: Upgrade pip
run: |
python -m pip install --upgrade pip setuptools wheel pybind11

- name: Set __release__
if: |
startsWith(github.ref, 'refs/tags/') ||
Expand Down Expand Up @@ -101,6 +105,10 @@ jobs:
python-version: ${{ matrix.python-version }}
update-environment: true

- name: Upgrade pip
run: |
python -m pip install --upgrade pip setuptools wheel pybind11

- name: Set __release__
if: |
startsWith(github.ref, 'refs/tags/') ||
Expand Down Expand Up @@ -145,7 +153,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
timeout-minutes: 45
steps:
Expand All @@ -161,6 +169,10 @@ jobs:
python-version: ${{ matrix.python-version }}
update-environment: true

- name: Upgrade pip
run: |
python -m pip install --upgrade pip setuptools wheel pybind11

- name: Set __release__
if: |
startsWith(github.ref, 'refs/tags/') ||
Expand Down Expand Up @@ -216,9 +228,13 @@ jobs:
uses: actions/setup-python@v4
if: startsWith(github.ref, 'refs/tags/')
with:
python-version: "3.7 - 3.11"
python-version: "3.7 - 3.12"
update-environment: true

- name: Upgrade pip
run: |
python -m pip install --upgrade pip setuptools wheel pybind11

- name: Set __release__
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
update-environment: true
allow-prereleases: true

- name: Upgrade pip
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add Python 3.12 support by [@XuehaiPan](https://github.com/XuehaiPan) in [#90](https://github.com/metaopt/optree/pull/90).
- Allow passing third-party dependency version from environment variable by [@XuehaiPan](https://github.com/XuehaiPan) in [#80](https://github.com/metaopt/optree/pull/80).

### Changed
Expand Down
6 changes: 5 additions & 1 deletion include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ limitations under the License.
#pragma once

#include <Python.h>

#if PY_VERSION_HEX < 0x30C00F0 // Python 3.12.0
#include <structmember.h> // PyMemberDef
#endif
Comment on lines 20 to +24
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


#include <pybind11/pybind11.h>
#include <structmember.h> // PyMemberDef

#include <memory>
#include <optional>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ test-command = """make -C "{project}" test PYTHON=python"""
safe = true
line-length = 100
skip-string-normalization = true
target-version = ["py37", "py38", "py39", "py310", "py311"]
target-version = ["py37", "py38", "py39", "py310", "py311", "py312"]

[tool.isort]
atomic = true
Expand Down
3 changes: 0 additions & 3 deletions src/treespec/treespec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ limitations under the License.

#include "include/treespec.h"

#include <Python.h>
#include <structmember.h> // PyMemberDef

namespace optree {

ssize_t PyTreeSpec::GetNumLeaves() const {
Expand Down