Skip to main content

A PEP 517 backend for PDM that supports PEP 621 metadata

Project description

PDM-PEP517

Yet another PEP 517 backend.

PyPI Tests pre-commit.ci status pdm-managed

This is the backend for PDM projects, while you can also use it alone. It reads the metadata of PEP 621 format and coverts it to Core metadata.

Use as PEP 517 build backend

Edit your pyproject.toml as follows:

[build-system]
requires = ["pdm-pep517"]
build-backend = "pdm.pep517.api"

Tool specific settings

Besides of the standard fields specified in PEP 621, PDM-PEP517 honors some other settings to change the build behavior. They should be defined under [tool.pdm] table:

[tool.pdm]
package-dir = "src"  # Similar to setuptools package_dir option
includes = []        # File patterns to include, the paths are relative to the project root.
excludes = []        # File patterns to exclude, the paths are relative to the project root.
source-includes = [] # File patterns to include in source distribution and exclude in wheel distribution

You don't have to specify all of them, PDM-PEP517 can also derive these fields smartly, based on some best practices of Python packaging.

Supported config settings

pdm-pep517 allows passing config_settings to modify the build behavior. It use the same option convention as python setup.py bdist_wheel.

--python-tag
    Override the python implementation compatibility tag(e.g. cp37, py3, pp3)
--py-limited-api
    Python tag (cp32|cp33|cpNN) for abi3 wheel tag
--plat-name
    Override the platform name(e.g. win_amd64, manylinux2010_x86_64)

For example, you can supply these options with build:

python -m build --sdist --wheel --outdir dist/ --config-setting="--python-tag=cp37" --config-setting="--plat-name=win_amd64"

pip doesn't support passing config_settings yet, please stick to build as the recommended frontend.

Support PEP 660 for setuptools backend

If your project need to support editable wheel build(PEP 660) and is backed by setuptools, you can write the following in pyproject.toml:

[build-system]
requires = ["pdm-pep517[setuptools]"]
build-backend = "pdm.pep517.setuptools"

PDM will infer the backend correctly so you don't need to do it.

License

This project is licensed under MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdm-pep517-0.8.1.tar.gz (185.6 kB view details)

Uploaded Source

Built Distribution

pdm_pep517-0.8.1-py3-none-any.whl (183.4 kB view details)

Uploaded Python 3

File details

Details for the file pdm-pep517-0.8.1.tar.gz.

File metadata

  • Download URL: pdm-pep517-0.8.1.tar.gz
  • Upload date:
  • Size: 185.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11

File hashes

Hashes for pdm-pep517-0.8.1.tar.gz
Algorithm Hash digest
SHA256 04dbe02ddeb3ad97547c13fa54fb56398edf1c6b51c454bf3e1dc8f423ae3777
MD5 03804f2d7fc075a48cf814e4c4d7cc06
BLAKE2b-256 0e74696a822dab49cc4a152b72907f9ce8b02a33c34370b460a03eb031c6f5c9

See more details on using hashes here.

Provenance

File details

Details for the file pdm_pep517-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: pdm_pep517-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 183.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11

File hashes

Hashes for pdm_pep517-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a978f2e2f9fb072170c2ccfbce2927318eadd36180a50137cd2f1bbc7a4eaf9
MD5 b7b68cb72795c387be77c0b438a7421f
BLAKE2b-256 4373c430f7e41977d56935591ff2de86c309931a92de8f84bca137ff8d0c55a0

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page