How to specify that a package is pure?
An analogue of this option with PDM: https://backend.pdm-project.org/build_config/#is-purelib
As a user this should happen automatically. Can you please explain what the issue is exactly?
I run CI pipelines that are conditional on this property.
How are you reading the property/what property?
The PDM property, by reading the pyproject.toml through PDM. Will share example code soon.
@ofek https://gitlab.com/han-aim/template/main/-/blob/721bb61461de3ade02453eb8dc3347b5f3704835/python/.gitlab-ci/releasepythonpackage-bootstrapped-production_script.sh#L28-31
The CI job then exits with a status conditional on the property.
@ofek What are your current thoughts?
Thanks for the reminder, I forgot!
The field you're checking for doesn't actually provide a guarantee as anything could happen at build time that includes non-Python files. The only way to check is to look at the resulting wheel metadata.
In the case of Hatchling, by default packages may only contain what is not ignored by the VCS which means probably no extension modules. If there are build hooks then you can't be sure without more information.
@ofek My use case is not to be sure, and it is to avoid having to build the wheel a priori. I only want an indication whether it's a purelib. PDM seems to provide this parameter. What's different with hatchling here?
Oh, then what you're asking is impossible because Hatchling allows for build hooks which can do anything.
PDM does too. I think there's a misunderstanding. I want informative metadata in the pyproject.toml that indicates when it's a purelib. That's certainly not impossible. But you seem to want some absolute truth in the pyproject.toml that then controls all aspects of hatchlings operation. That's not what I'm asking.