* Making py311 the default.
* Fixing release script.
* No default features everywhere.
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
- env:
- MATURIN_PEP517_ARGS: "--features py311,pyo3/extension-module"
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
- args: --release --out dist --manifest-path bindings/python/Cargo.toml --features pyo3/extension-module,${{ matrix.pyfeature }}
+ args: --release --out dist --manifest-path bindings/python/Cargo.toml --features pyo3/extension-module,${{ matrix.pyfeature }} --no-default-features
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
- args: --release --out dist --manifest-path bindings/python/Cargo.toml --features pyo3/extension-module,${{ matrix.pyfeature }}
+ args: --release --out dist --manifest-path bindings/python/Cargo.toml --features pyo3/extension-module,${{ matrix.pyfeature }} --no-default-features
sccache: 'true'
manylinux: musllinux_1_2
- name: Upload wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
- args: --release --out dist --manifest-path bindings/python/Cargo.toml --features pyo3/extension-module,${{ matrix.pyfeature }}
+ args: --release --out dist --manifest-path bindings/python/Cargo.toml --features pyo3/extension-module,${{ matrix.pyfeature }} --no-default-features
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
- args: --release --out dist --manifest-path bindings/python/Cargo.toml --features pyo3/extension-module,${{ matrix.pyfeature }}
+ args: --release --out dist --manifest-path bindings/python/Cargo.toml --features pyo3/extension-module,${{ matrix.pyfeature }} --no-default-features
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
name: Check everything builds & tests
runs-on: ${{ matrix.os }}
env:
- MATURIN_PEP517_ARGS: "--features ${{ matrix.version.pyfeature }},pyo3/extension-module"
+ MATURIN_PEP517_ARGS: "--no-default-features --features ${{ matrix.version.pyfeature }},pyo3/extension-module"
strategy:
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
- name: Lint with Clippy
run: |
- cargo clippy --features ${{ matrix.version.pyfeature }} -- -D warnings
+ cargo clippy --features ${{ matrix.version.pyfeature }} --no-default-features -- -D warnings
- name: Run Audit
run: cargo audit -D warnings
- name: Run tests
run: |
- cargo test --features ${{ matrix.version.pyfeature }}
+ cargo test --features ${{ matrix.version.pyfeature }} --no-default-features
pip install .[testing]
pytest -sv tests/
[
"--manifest-path",
"bindings/python/Cargo.toml",
- "--features",
- "py311",
"--all-targets",
"--",
"-Dwarnings",
[features]
py38 = ["pyo3/abi3-py38"]
py311 = ["pyo3/abi3-py311"]
+default = ["py311"]
[dependencies]
pyo3 = { version = "0.23", features = ["abi3"] }
static MLX_MODULE: GILOnceCell<Py<PyModule>> = GILOnceCell::new();
#[cfg(not(any(feature = "py38", feature = "py311")))]
-compile_error!(
- "At least one python version must be enabled, use `maturin develop --features py311,pyo3/extension-module`"
-);
+compile_error!("At least one python version must be enabled, use `maturin develop` for python 3.11, `maturin develop --features py38,pyo3/extension-module --no-default-features` for python 3.8");
#[cfg(all(feature = "py38", feature = "py311"))]
-compile_error!("Only one python version must be enabled");
+compile_error!("Only one python version must be enabled, make sure to deactivate default features for python <3.11");
/// Serializes raw data.
///
postShellHook = ''
unset SOURCE_DATE_EPOCH
'';
- LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.zlib}/lib";
+ LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.zlib}/lib:/run/opengl-driver/lib";
};
}