Package: pdm
PDMA modern Python package and dependency manager supporting the latest PEP standards.中文版本说明What is PDM?PDM is meant to be a next generation Python package management tool.
It was originally built for personal use. If you feel you are going well
withPipenvorPoetryand 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 inpdm.Highlights of featuresSimple and fast dependency resolver, mainly for large binary distributions.APEP 517build backend.PEP 621project metadata.Flexible and powerful plug-in system.Versatile user scripts.Opt-in centralized installation cache likepnpm.Comparisons to other alternativesPipenvPipenv is a dependency manager that combinespipandvenv, as the name implies.
It can install packages from a non-standardPipfile.lockorPipfile.
However, Pipenv does not handle any packages related to packaging your code,
so it’s useful only for developing non-installable applications (Django sites, for example).
If you’re a library developer, you needsetuptoolsanyway.PoetryPoetry manages environments and dependencies in a similar way to Pipenv,
but it can also build .whl files with your code, and it can upload wheels and source distributions to PyPI.
It has a pretty user interface and users can customize it via a plugin. Poetry uses thepyproject.tomlstandard,
but it does not follow the standard specifying how metadata should be represented in a pyproject.toml file (PEP 621),
instead using a custom[tool.poetry]table. This is partly because Poetry came out before PEP 621.HatchHatch can also manage environments, allowing multiple environments per project. By default it has a central location for all environments but it can be configured to put a project's environment(s) in the project root directory. It can manage packages but without lockfile support. It can also be used to package a project (with PEP 621 compliant pyproject.toml files) and upload it to PyPI.This projectPDM can manage virtual environments (venvs) in both project and centralized locations, similar to Pipenv. It reads project metadata from a standardizedpyproject.tomlfile and supports lockfiles. Users can add additional functionality through plugins, which can be shared by uploading them as distributions.Unlike Poetry and Hatch, PDM is not limited to a specific build backend; users have the freedom to choose any build backend they prefer.InstallationPDM requires python version 3.8 or higher.Via Install ScriptLike Pip, PDM provides an installation script that will install PDM into an isolated environment.For Linux/Maccurl-sSLhttps://pdm-project.org/install-pdm.py|python3-For Windows(Invoke-WebRequest-Urihttps://pdm-project.org/install-pdm.py-UseBasicParsing).Content|python-For security reasons, you should verify the checksum ofinstall-pdm.py.
It can be downloaded frominstall-pdm.py.sha256.The installer will install PDM into the user site and the location depends on the system:$HOME/.local/binfor Linux$HOME/Library/Python/<version>/binfor MacOS%APPDATA%\Python\Scriptson WindowsYou can pass additional options to the script to control how PDM is installed:usage: install-pdm.py [-h] [-v VERSION] [--prerelease] [--remove] [-p PATH] [-d DEP]

optional arguments:
  -h, --help            show this help message and exit
  -v VERSION, --version VERSION | envvar: PDM_VERSION
                        Specify the version to be installed, or HEAD to install from the main branch
  --prerelease | envvar: PDM_PRERELEASE    Allow prereleases to be installed
  --remove | envvar: PDM_REMOVE            Remove the PDM installation
  -p PATH, --path PATH | envvar: PDM_HOME  Specify the location to install PDM
  -d DEP, --dep DEP | envvar: PDM_DEPS     Specify additional dependencies, can be given multiple timesYou can either pass the options after the script or set the env var value.Alternative Installation MethodsIf you are on macOS and usinghomebrew, install it by:brewinstallpdmIf you are on Windows and usingScoop, install it by:scoop bucket add frostming https://github.com/frostming/scoop-frostming.git
scoop install pdmOtherwise, it is recommended to installpdmin an isolated environment withpipx:pipxinstallpdmOr you can install it under a user site:pipinstall--userpdmWithasdf-vmasdfpluginaddpdm
asdfinstallpdmlatestQuickstartInitialize a new PDM projectpdminitAnswer the questions following the guide, and a PDM project with apyproject.tomlfile will be ready to use.Install dependenciespdmaddrequestsflaskYou can add multiple dependencies in the same command. After a while, check thepdm.lockfile to see what is locked for each package.BadgesTell people you are using PDM in your project by including the markdown code in README.md:[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm-project.org)Packaging StatusPDM Eco-systemAwesome PDMis a curated list of awesome PDM plugins and resources.SponsorsCreditsThis project is strongly inspired bypyflowandpoetry.LicenseThis project is open sourced under MIT license, see theLICENSEfile for more details.