diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 476d040a..9869f8ad 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v6 with: - python-version: '3.10' + python-version: '3.11' - name: Install Rust run: rustup toolchain install "$RUSTUP_TOOLCHAIN" --profile minimal --component rustfmt --component clippy --no-self-update - name: Rust formatting diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83b986b5..658565c2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v6 with: - python-version: '3.10' + python-version: '3.11' - name: Install Rust run: rustup toolchain install "$RUSTUP_TOOLCHAIN" --profile minimal --no-self-update - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/wheels-build.yml b/.github/workflows/wheels-build.yml index 0dc0d57f..c4d89b5a 100644 --- a/.github/workflows/wheels-build.yml +++ b/.github/workflows/wheels-build.yml @@ -43,7 +43,7 @@ jobs: - uses: actions/setup-python@v6 if: runner.os != 'Linux' with: - python-version: '3.10' + python-version: '3.11' - name: Set up native build tools if: runner.os != 'Linux' run: | @@ -66,14 +66,14 @@ jobs: -e PLATFORM -e RUSTUP_TOOLCHAIN -e CARGO_PROFILE_DEV_DEBUG \ -e CARGO_PROFILE_TEST_DEBUG -e CARGO_INCREMENTAL -e CARGO_BUILD_JOBS \ "$IMAGE" bash -euo pipefail -c ' - export PATH="/opt/python/cp310-cp310/bin:$HOME/.cargo/bin:$PATH" + export PATH="/opt/python/cp311-cp311/bin:$HOME/.cargo/bin:$PATH" export CARGO_TARGET_DIR=/tmp/cqlib-manylinux-target curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs -o /tmp/rustup.sh sh /tmp/rustup.sh -y --profile minimal --default-toolchain "$RUSTUP_TOOLCHAIN" python -m pip install maturin==1.14.1 packaging==25.0 tomli==2.2.1 cmake==3.31.6 cargo test --locked -p cqlib-core -p binding-c -p cqlib python tools/ci.py release --platform "$PLATFORM" - for version in 311 312 313 314; do + for version in 312 313 314 315; do /opt/python/cp$version-cp$version/bin/python -m pip install packaging==25.0 /opt/python/cp$version-cp$version/bin/python tools/ci.py wheel-test done @@ -81,8 +81,8 @@ jobs: - uses: actions/setup-python@v6 if: runner.os != 'Linux' with: - python-version: '3.11' - - name: Test the same wheel on Python 3.11 + python-version: '3.12' + - name: Test the same wheel on Python 3.12 if: runner.os != 'Linux' run: | python -m pip install packaging==25.0 @@ -90,8 +90,8 @@ jobs: - uses: actions/setup-python@v6 if: runner.os != 'Linux' with: - python-version: '3.12' - - name: Test the same wheel on Python 3.12 + python-version: '3.13' + - name: Test the same wheel on Python 3.13 if: runner.os != 'Linux' run: | python -m pip install packaging==25.0 @@ -99,8 +99,8 @@ jobs: - uses: actions/setup-python@v6 if: runner.os != 'Linux' with: - python-version: '3.13' - - name: Test the same wheel on Python 3.13 + python-version: '3.14' + - name: Test the same wheel on Python 3.14 if: runner.os != 'Linux' run: | python -m pip install packaging==25.0 @@ -108,8 +108,8 @@ jobs: - uses: actions/setup-python@v6 if: runner.os != 'Linux' with: - python-version: '3.14' - - name: Test the same wheel on Python 3.14 + python-version: '3.15' + - name: Test the same wheel on Python 3.15 if: runner.os != 'Linux' run: | python -m pip install packaging==25.0 @@ -131,7 +131,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v6 with: - python-version: '3.10' + python-version: '3.11' - name: Install build tools run: | rustup toolchain install "$RUSTUP_TOOLCHAIN" --profile minimal --no-self-update diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9287db4d..a77d3f50 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -17,7 +17,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v6 with: - python-version: '3.10' + python-version: '3.11' - run: python -m pip install packaging==25.0 tomli==2.2.1 - name: Check tag and component versions env: diff --git a/CONTRIBUTING.CN.md b/CONTRIBUTING.CN.md index be94d093..107cb385 100644 --- a/CONTRIBUTING.CN.md +++ b/CONTRIBUTING.CN.md @@ -63,7 +63,7 @@ docs/ 文档相关文件 本项目当前要求: - Rust 1.89+ -- Python 3.10+ +- Python 3.11+ - C 11+ 工具链,用于 C 绑定相关开发 建议使用 `rustup` 管理 Rust 工具链,并使用 Python 虚拟环境隔离开发依赖。 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1e5dd35..85b899e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ Keep common changes scoped to the relevant module when possible, and avoid combi The project currently requires: - Rust 1.89+ -- Python 3.10+ +- Python 3.11+ - A C 11+ toolchain for C binding development We recommend using `rustup` for Rust toolchains and a Python virtual environment for Python dependencies. diff --git a/Cargo.lock b/Cargo.lock index 3bf21508..a23d7d0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,7 +165,7 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "binding-c" -version = "0.1.0-beta.4" +version = "0.1.0-beta.5" dependencies = [ "bitvec", "cbindgen", @@ -178,7 +178,7 @@ dependencies = [ [[package]] name = "binding-python" -version = "2.0.0-beta4" +version = "2.0.0-beta5" dependencies = [ "chrono", "cqlib-core", @@ -465,14 +465,14 @@ dependencies = [ [[package]] name = "cqlib" -version = "0.1.0-beta.4" +version = "0.1.0-beta.5" dependencies = [ "cqlib-core", ] [[package]] name = "cqlib-core" -version = "0.1.0-beta.4" +version = "0.1.0-beta.5" dependencies = [ "approx", "bitvec", diff --git a/Cargo.toml b/Cargo.toml index fb983169..12d91b1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.1.0-beta.4" +version = "0.1.0-beta.5" edition = "2024" rust-version = "1.89" license = "Apache-2.0" diff --git a/README.CN.md b/README.CN.md index 57419cb3..999bbda7 100644 --- a/README.CN.md +++ b/README.CN.md @@ -6,7 +6,7 @@ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE.txt) [![Rust](https://img.shields.io/badge/rust-1.89%2B-orange.svg)](https://www.rust-lang.org) -[![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org) +[![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org) [![C](https://img.shields.io/badge/c-11%2B-lightgrey.svg)](https://en.cppreference.com/w/c/11) [English](README.md) @@ -16,7 +16,7 @@ ## 概述 Cqlib 是一个高性能量子计算 SDK,为量子程序的构建、优化与执行提供统一基础。核心采用 Rust 实现,兼顾极致性能与内存安全,并原生支持 -Python 3.10+ 和 C 11+ 语言接口。 +Python 3.11+ 和 C 11+ 语言接口。 Cqlib 从底层设计兼顾科研与生产需求,覆盖量子计算全流程:从线路构建与参数化,到多层 IR 变换、基于规则的编译优化 Pass,再到搭载噪声模型的真实设备模拟,并内置零噪声外推(ZNE)和虚拟蒸馏(Virtual @@ -138,12 +138,12 @@ int main(void) { | 语言 | 最低版本 | 绑定技术 | |--------|------|-------------------| | Rust | 1.89 | 原生 | -| Python | 3.10 | PyO3 (abi3-py310) | +| Python | 3.11 | PyO3 (abi3-py311) | | C | 11 | cbindgen | ## 从源码构建 -**前置条件:** Rust 1.89+,Python 3.10+(用于 Python 绑定) +**前置条件:** Rust 1.89+,Python 3.11+(用于 Python 绑定) ```bash git clone https://gitee.com/cq-lib/cqlib.git diff --git a/README.md b/README.md index 46adcea9..b8db56a2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE.txt) [![Rust](https://img.shields.io/badge/rust-1.89%2B-orange.svg)](https://www.rust-lang.org) -[![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org) +[![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org) [![C](https://img.shields.io/badge/c-11%2B-lightgrey.svg)](https://en.cppreference.com/w/c/11) [中文文档](README.CN.md) @@ -17,7 +17,7 @@ Cqlib is a high-performance quantum computing SDK that provides a unified foundation for building, optimizing, and executing quantum programs. Its core is written in Rust for maximum safety and speed, with first-class language bindings -for Python 3.10+ and C 11+. +for Python 3.11+ and C 11+. Designed from the ground up for both research and production use, Cqlib covers the full quantum computing workflow: from circuit construction and parameterization, through multi-level IR transformations, rule-based compilation and @@ -142,12 +142,12 @@ int main(void) { | Language | Minimum Version | Binding Technology | |----------|-----------------|--------------------| | Rust | 1.89 | Native | -| Python | 3.10 | PyO3 (abi3-py310) | +| Python | 3.11 | PyO3 (abi3-py311) | | C | 11 | cbindgen | ## Building from Source -**Prerequisites:** Rust 1.89+, Python 3.10+ (for Python bindings) +**Prerequisites:** Rust 1.89+, Python 3.11+ (for Python bindings) ```bash git clone https://gitee.com/cq-lib/cqlib.git diff --git a/crates/binding-c/Cargo.toml b/crates/binding-c/Cargo.toml index 312365b9..216f3683 100644 --- a/crates/binding-c/Cargo.toml +++ b/crates/binding-c/Cargo.toml @@ -9,7 +9,7 @@ license.workspace = true crate-type = ["rlib", "staticlib", "cdylib"] [dependencies] -cqlib-core = { path = "../cqlib-core", version = "0.1.0-beta.4" } +cqlib-core = { path = "../cqlib-core", version = "0.1.0-beta.5" } libc = "0.2" bitvec.workspace = true ndarray.workspace = true diff --git a/crates/binding-python/Cargo.toml b/crates/binding-python/Cargo.toml index 93619fe1..942962ac 100644 --- a/crates/binding-python/Cargo.toml +++ b/crates/binding-python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binding-python" -version = "2.0.0-beta4" +version = "2.0.0-beta5" edition.workspace = true rust-version.workspace = true license-file.workspace = true @@ -12,9 +12,9 @@ name = "_native" crate-type = ["cdylib", "rlib"] [dependencies] -pyo3 = { version = "0.29", features = ["abi3-py310", "num-complex", "chrono"] } +pyo3 = { version = "0.29", features = ["abi3-py311", "num-complex", "chrono"] } chrono = "0.4" -cqlib-core = { path = "../cqlib-core", version = '0.1.0-beta.4' } +cqlib-core = { path = "../cqlib-core", version = '0.1.0-beta.5' } num-complex.workspace = true numpy.workspace = true rustworkx-core.workspace = true diff --git a/crates/binding-python/README.md b/crates/binding-python/README.md index d9c4e507..9062b64d 100644 --- a/crates/binding-python/README.md +++ b/crates/binding-python/README.md @@ -10,7 +10,7 @@ mitigation, and visualization. ## Installation -Cqlib requires Python 3.10 or later. +Cqlib requires Python 3.11 or later. Install the latest pre-release from PyPI: @@ -50,7 +50,7 @@ bound = circuit.assign_parameters({"theta": 0.5}) ## Supported environments -- Python 3.10 or later on CPython +- CPython 3.11–3.15 with the GIL enabled - Linux, macOS, and Windows - Type information is included for static type checkers diff --git a/crates/binding-python/pyproject.toml b/crates/binding-python/pyproject.toml index 1d92fce9..837ae1be 100644 --- a/crates/binding-python/pyproject.toml +++ b/crates/binding-python/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "cqlib" description = "A high-performance quantum computing SDK with a Rust core and Python bindings." -requires-python = ">=3.10" +requires-python = ">=3.11" license = "Apache-2.0" readme = "README.md" authors = [ @@ -15,11 +15,11 @@ classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Topic :: Software Development :: Libraries", "Typing :: Typed", ] diff --git a/crates/cqlib-core/README.md b/crates/cqlib-core/README.md index 6498e6b9..696a7225 100644 --- a/crates/cqlib-core/README.md +++ b/crates/cqlib-core/README.md @@ -14,13 +14,13 @@ Add the crate to your project: ```toml [dependencies] -cqlib-core = "0.1.0-beta.4" +cqlib-core = "0.1.0-beta.5" ``` Or use Cargo: ```shell -cargo add cqlib-core@0.1.0-beta.4 +cargo add cqlib-core@0.1.0-beta.5 ``` ## Quick start diff --git a/crates/cqlib/Cargo.toml b/crates/cqlib/Cargo.toml index b39632ec..650a1265 100644 --- a/crates/cqlib/Cargo.toml +++ b/crates/cqlib/Cargo.toml @@ -26,4 +26,4 @@ categories = [ [dependencies] -cqlib-core = { path = "../cqlib-core", version = "0.1.0-beta.4" } +cqlib-core = { path = "../cqlib-core", version = "0.1.0-beta.5" } diff --git a/docs/documentation/cn/0_get_started/1_installation.md b/docs/documentation/cn/0_get_started/1_installation.md index 22fa4837..513249d0 100644 --- a/docs/documentation/cn/0_get_started/1_installation.md +++ b/docs/documentation/cn/0_get_started/1_installation.md @@ -4,7 +4,7 @@ 在安装 Cqlib 之前,请确保您的计算机环境满足以下条件: -- Python 环境:支持 Python 3.10 – 3.14(建议使用 64 位版本); +- Python 环境:支持启用 GIL 的 CPython 3.11 – 3.15(建议使用 64 位版本); - 操作系统: - Linux - macOS diff --git a/docs/documentation/cn/0_get_started/2_quickstart.md b/docs/documentation/cn/0_get_started/2_quickstart.md index 8c7889ba..308b59fd 100644 --- a/docs/documentation/cn/0_get_started/2_quickstart.md +++ b/docs/documentation/cn/0_get_started/2_quickstart.md @@ -4,7 +4,7 @@ 在开始之前,请确保您的环境已准备就绪: -- Python 环境:支持 Python 3.10 – 3.14 +- Python 环境:支持启用 GIL 的 CPython 3.11 – 3.15 - 完成 Cqlib 安装与环境配置(安装方式见 “[Cqlib 安装与环境配置](../0_get_started/1_installation.md)”) --- diff --git a/docs/documentation/en/0_get_started/1_installation.md b/docs/documentation/en/0_get_started/1_installation.md index 74a39b3a..a6c6c0d3 100644 --- a/docs/documentation/en/0_get_started/1_installation.md +++ b/docs/documentation/en/0_get_started/1_installation.md @@ -4,7 +4,7 @@ This guide covers the installation of Cqlib and the setup of a development envir Before installing Cqlib, ensure that the environment meets the following conditions: -- Python environment: Python 3.10 – 3.14 is supported (a 64-bit build is recommended); +- Python environment: CPython 3.11 – 3.15 with the GIL enabled is supported (a 64-bit build is recommended); - Operating system: - Linux - macOS diff --git a/docs/documentation/en/0_get_started/2_quickstart.md b/docs/documentation/en/0_get_started/2_quickstart.md index 8f3c04a8..437bca81 100644 --- a/docs/documentation/en/0_get_started/2_quickstart.md +++ b/docs/documentation/en/0_get_started/2_quickstart.md @@ -4,7 +4,7 @@ This guide builds a minimal working quantum circuit with Cqlib and completes an Before starting, ensure that the environment is ready: -- Python environment: Python 3.10 – 3.14 is supported +- Python environment: CPython 3.11 – 3.15 with the GIL enabled is supported - Cqlib is installed and the environment is configured (for installation, see "[Cqlib Installation and Environment Setup](../0_get_started/1_installation.md)") --- diff --git a/docs/releasing.md b/docs/releasing.md index 06fb84c7..2d2fa6a7 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -39,16 +39,16 @@ Tags use the Python version to identify a release batch: - Stable releases: `vX.Y.Z`. - Prereleases: `vX.Y.Z-alpha.N`, `vX.Y.Z-beta.N`, or `vX.Y.Z-rc.N`, with N starting at 1. -- Current tag: `v2.0.0-beta.4`. -- Current Python source version: `2.0.0-beta4`, normalized to `2.0.0b4` for PEP 440 and wheel filenames. -- Current Rust/C version: `0.1.0-beta.4`; both inherit the workspace version. +- Current tag: `v2.0.0-beta.5`. +- Current Python source version: `2.0.0-beta5`, normalized to `2.0.0b5` for PEP 440 and wheel filenames. +- Current Rust/C version: `0.1.0-beta.5`; both inherit the workspace version. Python and Rust/C versions evolve independently and do not need matching numbers. The Cargo.toml files at a given tag record the version mapping for that release; no separate release.toml is maintained. CI checks that the tag is equivalent to the Python version, core dependency -versions are consistent across bindings, the minimum Python version is 3.10, -and `abi3-py310` is enabled. Maintainers must update versions before tagging. +versions are consistent across bindings, the minimum Python version is 3.11, +and `abi3-py311` is enabled. Maintainers must update versions before tagging. ## Platforms and Artifacts @@ -69,8 +69,8 @@ Images use the latest tag, with the resolved digest recorded in logs. On macOS, CI checks the shared library's minimum deployment version. Tests actually run on macOS 15; this does not constitute execution testing on macOS 11. -Each platform produces one `cp310-abi3` wheel. That same wheel is installed into -separate CPython 3.10, 3.11, 3.12, 3.13, and 3.14 environments for import checks, +Each platform produces one `cp311-abi3` wheel. That same wheel is installed into +separate CPython 3.11, 3.12, 3.13, 3.14, and 3.15 environments for import checks, pip check, and the full pytest suite. Tests are copied alongside the installed package to satisfy existing sibling-directory assertions. They do not import cqlib from the checkout, and existing tests are not modified, skipped, or marked diff --git a/tools/ci.py b/tools/ci.py index ccb5c4c6..ad2257ce 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -50,12 +50,12 @@ def versions(tag=None): binding = read_toml(BINDING / "Cargo.toml") python = str(Version(binding["package"]["version"])) require( - "abi3-py310" in binding["dependencies"]["pyo3"]["features"], - "Require abi3-py310", + "abi3-py311" in binding["dependencies"]["pyo3"]["features"], + "Require abi3-py311", ) require( - read_toml(BINDING / "pyproject.toml")["project"]["requires-python"] == ">=3.10", - "Require Python >=3.10", + read_toml(BINDING / "pyproject.toml")["project"]["requires-python"] == ">=3.11", + "Require Python >=3.11", ) for member in ("binding-python", "binding-c", "cqlib"): manifest = read_toml(ROOT / "crates" / member / "Cargo.toml") @@ -170,8 +170,8 @@ def verify_wheel(directory=DIST): name == "cqlib" and version == Version(versions()[0]), "Wrong wheel version" ) require( - all(t.interpreter == "cp310" and t.abi == "abi3" for t in tags), - "Wheel must use cp310-abi3", + all(t.interpreter == "cp311" and t.abi == "abi3" for t in tags), + "Wheel must use cp311-abi3", ) with tempfile.TemporaryDirectory(prefix="cqlib-wheel-") as temporary: directory = Path(temporary)