Skip to main content

Python Development Master

Project description

PDM - Python Development Master

A modern Python package manager with PEP 582 support. 中文版本说明

Github Actions PyPI

asciicast

📖 Documentation

What is PDM?

PDM is meant to be a next generation Python package management tool. It is originally built for personal interest. If you feel you are going well with Pipenv or Poetry and don't want to introduce another package manager, just stick to it. But if you are missing something that is not present in those tools, you can probably find some goodness in pdm.

Highlights of features

  • PEP 582 local package installer and runner, no virtualenv involved at all.
  • Simple and relatively fast dependency resolver, mainly for large binary distributions.
  • A PEP 517 build backend.

Why not virtualenv?

Now the majority of Python packaging tools also act as virtualenv managers. It is for the benifit of isolating project environments. But things will get tricky when it comes to nested venvs: One installs the virtualenv manager using a venv capsulated Python, and create more venvs using the tool which is based on a capsulated Python. One day a minor release of Python out and one has to check all those venvs and upgrade them if required.

While PEP 582, in the other hand, introduce a way to decouple Python interpreter with project environments. It is a relative new proposal and there are not many tools supporting it, among which there is pyflow, but it is written with Rust and can't get much help from the big Python community. Moreover, due to the same reason, it can't act as a PEP 517 backend.

Installation:

PDM requires python version 3.7 or higher.

It is recommended to install pdm in an isolated enviroment, with pipx.

$ pipx install pdm

Or you can install it under user site:

$ pip install --user pdm

Usage

python -m pdm --help should be a good guidance.

FAQ

1. What is put in __pypackages__?

PEP 582 is a draft proposal which still needs a lot of polishment, for instance, it doesn't mention how to manage CLI executables. PDM take the decision to put bin, include together with lib under __pypackages__/X.Y.

2. How do I run CLI scripts in the local package directory?

The recommended way is to prefix your command with pdm run. It is also possible to run CLI scripts directly from the outside, the PDM's installer has already injected the package path to the sys.path in the entry script file.

3. What site-packages will be loaded when using PDM?

PDM first looks to __pypackages__ but will fall back to looking in site-packages. This is not entirely hermetic and could lead to some confusion around which packages are being used, though.

4. Can I relocate or move the __pypackages__ folder for deployment?

You'd better not. The packages installed inside __pypackages__ are OS dependent. Instead, you should keep pdm.lock in VCS and do pdm sync on the target environment to deploy.

5. Can I use pdm to manage a Python 2.7 project?

Sure. The pdm itself can be installed under Python 3.7+ only, but it doesn't restrict the Python used by the project.

Credits

This project is strongly inspired by pyflow and poetry.

License

This project is open sourced under MIT license, see the LICENSE file for more details.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

pdm-0.4.1.tar.gz (65.8 kB view details)

Uploaded Source

Built Distribution

pdm-0.4.1-py3-none-any.whl (78.9 kB view details)

Uploaded Python 3

File details

Details for the file pdm-0.4.1.tar.gz.

File metadata

  • Download URL: pdm-0.4.1.tar.gz
  • Upload date:
  • Size: 65.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for pdm-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f1c9fd69dcf0561fb8a6cf5644c93a267eb7f65532efc34f979809ca6e15764c
MD5 75a1691d3c08132fcd0fc7b41c9c767d
BLAKE2b-256 d6237342814ad17ec299de6983994a59dedca8be342058012f88f0c76953d51d

See more details on using hashes here.

Provenance

File details

Details for the file pdm-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: pdm-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 78.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for pdm-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f9bd44671d2972eb6f80f1a1d1f0851569872a1226f902f314359a4c91ea90f
MD5 ecad0e4cb3d48bbc9bfcf997f05b648f
BLAKE2b-256 01a20bd07c2559473897c74b0e1473a3e152365249ca045be01fd3da7d0d4ac9

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