Struct maturin::pyproject_toml::PyProjectToml
source · pub struct PyProjectToml {
pub build_system: BuildSystem,
pub project: Option<Project>,
pub tool: Option<Tool>,
}
Expand description
A pyproject.toml as specified in PEP 517
Fields§
§build_system: BuildSystem
Build-related data
project: Option<Project>
Project metadata
tool: Option<Tool>
PEP 518: The [tool]
table is where any tool related to your Python project, not just build
tools, can have users specify configuration data as long as they use a sub-table within
[tool]
, e.g. the flit tool would store its configuration in [tool.flit]
.
We use it for [tool.maturin]
Implementations§
source§impl PyProjectToml
impl PyProjectToml
sourcepub fn new(pyproject_file: impl AsRef<Path>) -> Result<PyProjectToml>
pub fn new(pyproject_file: impl AsRef<Path>) -> Result<PyProjectToml>
Returns the contents of a pyproject.toml with a [build-system]
entry or an error
Does no specific error handling because it’s only used to check whether or not to build source distributions
sourcepub fn project_name(&self) -> Option<&str>
pub fn project_name(&self) -> Option<&str>
Returns the value of [project.name]
in pyproject.toml
sourcepub fn maturin(&self) -> Option<&ToolMaturin>
pub fn maturin(&self) -> Option<&ToolMaturin>
Returns the values of [tool.maturin]
in pyproject.toml
sourcepub fn module_name(&self) -> Option<&str>
pub fn module_name(&self) -> Option<&str>
Returns the value of [tool.maturin.module-name]
in pyproject.toml
sourcepub fn include(&self) -> Option<&[GlobPattern]>
pub fn include(&self) -> Option<&[GlobPattern]>
Returns the value of [tool.maturin.include]
in pyproject.toml
sourcepub fn exclude(&self) -> Option<&[GlobPattern]>
pub fn exclude(&self) -> Option<&[GlobPattern]>
Returns the value of [tool.maturin.exclude]
in pyproject.toml
sourcepub fn bindings(&self) -> Option<&str>
pub fn bindings(&self) -> Option<&str>
Returns the value of [tool.maturin.bindings]
in pyproject.toml
sourcepub fn compatibility(&self) -> Option<PlatformTag>
pub fn compatibility(&self) -> Option<PlatformTag>
Returns the value of [tool.maturin.compatibility]
in pyproject.toml
sourcepub fn skip_auditwheel(&self) -> bool
pub fn skip_auditwheel(&self) -> bool
Returns the value of [tool.maturin.skip-auditwheel]
in pyproject.toml
sourcepub fn sdist_generator(&self) -> SdistGenerator
pub fn sdist_generator(&self) -> SdistGenerator
Returns the value of [tool.maturin.sdist-generator]
in pyproject.toml
sourcepub fn python_source(&self) -> Option<&Path>
pub fn python_source(&self) -> Option<&Path>
Returns the value of [tool.maturin.python-source]
in pyproject.toml
sourcepub fn python_packages(&self) -> Option<&[String]>
pub fn python_packages(&self) -> Option<&[String]>
Returns the value of [tool.maturin.python-packages]
in pyproject.toml
sourcepub fn targets(&self) -> Option<Vec<CargoTarget>>
pub fn targets(&self) -> Option<Vec<CargoTarget>>
Returns the value of [tool.maturin.targets]
in pyproject.toml
sourcepub fn target_config(&self, target: &str) -> Option<&TargetConfig>
pub fn target_config(&self, target: &str) -> Option<&TargetConfig>
Returns the value of [tool.maturin.target.<target>]
in pyproject.toml
sourcepub fn manifest_path(&self) -> Option<&Path>
pub fn manifest_path(&self) -> Option<&Path>
Returns the value of [tool.maturin.manifest-path]
in pyproject.toml
sourcepub fn warn_bad_maturin_version(&self) -> bool
pub fn warn_bad_maturin_version(&self) -> bool
Warn about build-system.requires
mismatching expectations.
Having a pyproject.toml without a version constraint is a bad idea because at some point we’ll have to do breaking changes and then source distributions would break.
The second problem we check for is the current maturin version not matching the constraint.
Returns false if a warning was emitted.
sourcepub fn warn_missing_build_backend(&self) -> bool
pub fn warn_missing_build_backend(&self) -> bool
Having a pyproject.toml without build-backend
set to maturin
may result in build errors when build from source distribution
Returns true if the pyproject.toml has build-backend
set to maturin
Trait Implementations§
source§impl Clone for PyProjectToml
impl Clone for PyProjectToml
source§fn clone(&self) -> PyProjectToml
fn clone(&self) -> PyProjectToml
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more