From 45aff871acac61e0d777e9210c0bd92adbc4a121 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Wed, 26 Oct 2022 14:16:26 +0800 Subject: [PATCH 1/2] chore: enable Python 3.11 build --- .github/workflows/build.yml | 11 ++++------- .github/workflows/tests.yml | 6 ++---- README.md | 2 +- pyproject.toml | 3 ++- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfd0ce3a..468a3dcc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.7 - 3.10" + python-version: "3.7 - 3.11" update-environment: true - name: Set __release__ @@ -96,7 +96,6 @@ jobs: fetch-depth: 0 - name: Set up Python - id: py uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -137,7 +136,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10', '3.11'] fail-fast: false timeout-minutes: 30 steps: @@ -148,7 +147,6 @@ jobs: fetch-depth: 0 - name: Set up Python - id: py uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -200,7 +198,7 @@ jobs: uses: actions/setup-python@v4 if: startsWith(github.ref, 'refs/tags/') with: - python-version: "3.7 - 3.10" + python-version: "3.7 - 3.11" update-environment: true - name: Set __release__ @@ -246,8 +244,7 @@ jobs: path: dist - name: List distributions - run: - ls -lh dist/* + run: ls -lh dist/* - name: Publish to TestPyPI if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6881aa56..8e5ceb33 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.7'] + python-version: ["3.7"] fail-fast: false timeout-minutes: 30 steps: @@ -44,7 +44,6 @@ jobs: fetch-depth: 1 - name: Set up Python - id: py uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -81,7 +80,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.6', '3.8', '3.9', '3.10'] + python-version: ["3.6", "3.8", "3.9", "3.10", "3.11"] fail-fast: false timeout-minutes: 30 steps: @@ -92,7 +91,6 @@ jobs: fetch-depth: 1 - name: Set up Python - id: py uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/README.md b/README.md index 042e47a1..b6f4686d 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ There are several limitations of the pytree type registry: 1. **The type registry is per-interpreter-dependent.** This means registering a custom type in the registry affects all modules that use OpTree. The type registry does not support per-module isolation such as namespaces. 2. **The elements in the type registry are immutable.** Users either cannot register the same type twice (i.e., update the type registry). Nor cannot remove a type from the type registry. 3. **Users cannot modify the behavior of already registered built-in types** listed [Built-in PyTree Node Types](#built-in-pytree-node-types), such as key order sorting for `dict` and `collections.defaultdict`. -4. **Inherited subclasses are not implicitly registered.** The registration lookup uses `type(obj) is registered_type` rather than `isinstance(obj, registered_type)`. Users need to explicitly register all custom classes explicitly. +4. **Inherited subclasses are not implicitly registered.** The registration lookup uses `type(obj) is registered_type` rather than `isinstance(obj, registered_type)`. Users need to register the subclasses explicitly. ### `None` is non-leaf Node vs. `None` is Leaf diff --git a/pyproject.toml b/pyproject.toml index 09cff22a..462bdbee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Operating System :: MacOS", @@ -88,7 +89,7 @@ test-command = """make -C "{project}" test PYTHON=python""" safe = true line-length = 100 skip-string-normalization = true -target-version = ["py36", "py37", "py38", "py39", "py310"] +target-version = ["py36", "py37", "py38", "py39", "py310", "py311"] [tool.isort] profile = "black" From 1255c8397f93540ec14f99ef7b2a9fa62966324b Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Thu, 27 Oct 2022 16:07:38 +0800 Subject: [PATCH 2/2] deps: bump cibuildwheel to v2.11.2 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 468a3dcc..6c09a2fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: run: python .github/workflows/set_cibw_build.py - name: Build wheels - uses: pypa/cibuildwheel@v2.11.1 + uses: pypa/cibuildwheel@v2.11.2 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} with: @@ -165,7 +165,7 @@ jobs: run: python .github/workflows/set_cibw_build.py - name: Build wheels - uses: pypa/cibuildwheel@v2.11.1 + uses: pypa/cibuildwheel@v2.11.2 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} with: