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

fix: update maturin #239

Merged
merged 2 commits into from
Jul 21, 2023
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
7 changes: 1 addition & 6 deletions docs/pages/guides/packaging_compiled.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,11 @@ name = "_core"
# "cdylib" is necessary to produce a shared library for Python to import from.
crate-type = ["cdylib"]

[package.metadata.maturin]
name = "package._core"
python-packages = ["package"]
python-source = "src"

[dependencies]
rand = "0.8.3"

[dependencies.pyo3]
version = "0.18.1"
version = "0.19.1"
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
# "abi3-py38" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.8
features = ["extension-module", "abi3-py38"]
Expand Down
13 changes: 11 additions & 2 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "whey"
requires = ["pdm-backend"]
build-backend = "pdm.backend"
{%- elif cookiecutter.backend == "maturin" %}
requires = ["maturin>=0.12,<0.15"]
requires = ["maturin>=0.15,<2"]
build-backend = "maturin"
{%- elif cookiecutter.backend == "hatch" %}
requires = ["hatchling"]
Expand All @@ -15,7 +15,7 @@ build-backend = "hatchling.build"
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
{%- elif cookiecutter.backend == "flit" %}
requires = ["flit_core >=3.4"]
requires = ["flit_core>=3.4"]
build-backend = "flit_core.buildapi"
{%- elif cookiecutter.backend == "setuptools" %}
requires = ["setuptools>=42", "setuptools_scm[toml]>=3.4"]
Expand Down Expand Up @@ -199,6 +199,15 @@ build-dir = "build/{wheel_tag}"
[tool.whey]
source-dir = "src"

{%- elif cookiecutter.backend == "maturin" %}


[tool.maturin]
module-name = "{{ cookiecutter.__project_slug }}._core"
python-packages = ["{{ cookiecutter.__project_slug }}"]
python-source = "src"
sdist-generator = "git" # default is cargo

{%- elif cookiecutter.backend == "hatch" %}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ name = "_core"
# "cdylib" is necessary to produce a shared library for Python to import from.
crate-type = ["cdylib"]

[package.metadata.maturin]
name = "{{ cookiecutter.__project_slug }}._core"
python-packages = ["{{ cookiecutter.__project_slug }}"]
python-source = "src"

[dependencies]
rand = "0.8.3"

[dependencies.pyo3]
version = "0.18.1"
version = "0.19.1"
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
# "abi3-py38" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.8
features = ["extension-module", "abi3-py38"]
Loading