未验证 提交 78657f59 编写于 作者: F frostming

documentation

上级 bce838cb
name: Documentation
on:
push:
branches:
- master
jobs:
build-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.7
architecture: 'x64'
- name: Build pages
run: |
pip install mkdocs mkdocs-material
cd docs && mkdocs build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.REPO_TOKEN }}
publish_dir: ./docs/site
......@@ -70,7 +70,7 @@ instance/
# Sphinx documentation
docs/_build/
docs/site
# PyBuilder
target/
......
......@@ -5,6 +5,8 @@ A modern Python package manager with PEP 582 support. [中文版本说明](READM
![Github Actions](https://github.com/pdm-project/pdm/workflows/Tests/badge.svg)
![PyPI](https://img.shields.io/pypi/v/pdm?logo=python&logoColor=%23cccccc)
[Documentation](https://frostming.github.io/pdm)
## What is PDM?
PDM is meant to be a next generation Python package management tool.
......
......@@ -3,6 +3,9 @@
一个现代的 Python 包管理器,支持 PEP 582。[English version README](README.md)
![Github Actions](https://github.com/pdm-project/pdm/workflows/Tests/badge.svg)
![PyPI](https://img.shields.io/pypi/v/pdm?logo=python&logoColor=%23cccccc)
[文档](https://frostming.github.io/pdm)
## 这个项目是啥?
......
# Manage dependencies
PDM provides a bunch of handful commands to help manage your project and dependencies.
The following examples are run on Ubuntu 18.04, a few changes must be done if you are using Windows.
## Initialize a project
```bash
$ mkdir pdm-test && cd pdm-test
$ pdm init
```
Answer several questions asked by PDM and a `pyproject.toml` will be created for you in the project root:
```toml
[tool.pdm]
name = "pdm-test"
version = "0.0.0"
description = ""
author = "Frost Ming <mianghong@gmail.com>"
license = "MIT"
python_requires = ">=3.7"
[tool.pdm.dependencies]
[tool.pdm.dev-dependencies]
```
If `pyproject.toml` is already present, it will be updated with `tool.pdm` contents.
For details of the meaning of each field in `pyproject.toml`, please refer to [Project File](/pyproject).
## Add dependencies
```bash
$ pdm add requests
$ pdm add -d pytest
```
`pdm add` can be followed by one or several dependencies, and the dependency specification is described in
[PEP 508](https://www.python.org/dev/peps/pep-0508/).
There are two groups of dependencies: packages will be added to `[tool.pdm.dependencies]` by default or `[tool.pdm.dev-dependencies]`
if `-d/--dev` option is passed to the `pdm add` command.
PDM also allows custom dependency groups by providing `-s/--section <name>` option, and the dependencies will apear in
`[tool.pdm.<name>-dependencies]` in the project file, respectively.
After that, dependencies and sub-dependencies will be resolved properly and installed for you, you can view `pdm.lock` to see
the resolved result of all dependencies.
### Save version specifiers
If the package is given without a version specifier like `pdm add requests`. PDM provides three different behaviors of what version
specifier is saved for the dependency, which is given by `--save-<strategy>`(Assume `2.21.0` is the latest version that can be found
for the dependency):
- `compatible`: Save the compatible version specifier: `>=2.21.0,<3.0.0`(default).
- `exact`: Save the exact version specifier: `==2.21.0`.
- `wildcard`: Don't constrain version and leave the specifier to be wildcard: `*`.
## Update existing dependencies
To update all dependencies in the lock file:
```bash
$ pdm update
```
To update the specified package(s):
```bash
$ pdm update requests
```
### About update strategy
Similary, PDM also provides 2 different behaviors of updating dependencies and sub-dependencies,
which is given by `--update-<strategy>` option:
- `reuse`: Keep all locked dependencies except for those given in the command line.
- `eager`: Try to lock a newer version of the packages in command line and their recursive sub-dependencies
and keep other dependencies as they are.
## Remove existing dependencies
To remove existing dependencies from project file and the library directory:
```bash
$ pdm remove requests
```
## Synchronize the project packages with lock file
There are two similar commands to do this job with a slight difference:
- `pdm install` will check the lock file and relock if it mismatch with project file, then install.
- `pdm sync` install dependencies in the lock file and will error out if it doesn't exist.
Besides, `pdm sync` can also remove unneeded packages if `--clean` option is given.
## Show what packages are installed
Similar to `pip list`, you can list all packages installed in the packages directory:
```bash
$ pdm list
```
Or show a dependency graph by:
```
$ pdm list --graph
tempenv 0.0.0
└── click 7.0 [ required: <7.0.0,>=6.7 ]
black 19.10b0
├── appdirs 1.4.3 [ required: Any ]
├── attrs 19.3.0 [ required: >=18.1.0 ]
├── click 7.0 [ required: >=6.5 ]
├── pathspec 0.7.0 [ required: <1,>=0.6 ]
├── regex 2020.2.20 [ required: Any ]
├── toml 0.10.0 [ required: >=0.9.4 ]
└── typed-ast 1.4.1 [ required: >=1.4.0 ]
bump2version 1.0.0
```
# Introduction
PDM is a modern Python package manager with [PEP 582] support. It installs and manages packages
in a similar way to `npm` that doesn't need to create a virtualenv at all!
[PEP 582]: https://www.python.org/dev/peps/pep-0582/
## Feature highlights
- 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.
## Installation
PDM requires Python 3.7+ to be installed. It works on multiple platforms including Windows, Linux and MacOS.
!!! note
There is no restriction about what Python version that your project is using but installing
PDM itself needs Python 3.7+.
### Recommended installation method
To avoid messing up with the system Python environemnt, the most recommended way to install PDM
is via [pipx](https://pypi.org/project/pipx):
```bash
$ pipx install pdm
```
### Other installation methods
Install PDM into user site with `pip`:
```bash
$ pip install --user pdm
```
# Manage project
PDM can act as a PEP 517 build backend, to enable that, write the following lines in your
`pyproject.toml`. If you used `pdm init` to create it for you, it should be done already.
```toml
[build-system]
requires = ["pdm"]
build-backend = "pdm.builders.api"
```
`pip` will read the backend settings to install or build a package.
!!! note "About editable installation"
As described, [PEP 517](https://www.python.org/dev/peps/pep-0517/) doesn't provide a
way to specify how to install a package in editable mode. So you can't install a PEP 517
package by `pip install -e <path_or_url>`. But PDM can install a "PDM package" in editable
mode.
## Choose a Python interpreter
If you have used `pdm init`, you must have already seen how PDM detects and selects the Python
interpreter. After initialized, you can also change the settings by `pdm use <python_version_or_path>`.
The argument can be either a version specifier of any length, or a relative or absolute path to the
python interpreter, but remember the Python interpreter must be compatible with `python_requires`
constraint in the project file.
### How `python_requires` controls the project
PDM respects the value of `python_requires` in the way that it tries to pick package candidates that can work
on all python versions that `python_requires` contains. For example if `python_requires` is `>=2.7`, PDM will try
to find the latest version of `foo`, whose `python_requires` version range is a **superset** of `>=2.7`.
So, make sure you write `python_requires` properly if you don't want any outdated packages to be locked.
## Build distribution artifacts
```bash
$ pdm build
- Building sdist...
- Built pdm-test-0.0.0.tar.gz
- Building wheel...
- Built pdm_test-0.0.0-py3-none-any.whl
```
The artifacts can then be uploaded to PyPI by [twine](https://pypi.org/project/twine).
# Project file syntax
## Project metadata
site_name: PDM - Python Development Master
repo_url: https://github.com/frostming/pdm
theme:
name: material
nav:
- index.md
- dependency.md
- project.md
- pyproject.md
markdown_extensions:
- codehilite
- admonition
copyright: Copyright &copy; 2019 <a href="https://frostming.com">Frost Ming</a>
......@@ -34,9 +34,9 @@ summary = "A decorator for caching properties in classes."
[[package]]
name = "click"
sections = ["default", "dev"]
sections = ["default", "dev", "doc"]
version = "7.0"
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2, 3.3\""
marker = "python_version >= \"2.7\""
summary = "Composable command line interface toolkit"
[[package]]
......@@ -50,7 +50,7 @@ summary = "Cross-platform colored terminal text."
name = "coverage"
sections = ["dev"]
version = "4.4.2"
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2, 3.3\""
marker = "python_version >= \"2.7\" and python_version < \"4.0\" and python_version not in \"3.0, 3.1, 3.2, 3.3, 3.4\""
summary = "Code coverage measurement for Python"
[[package]]
......@@ -85,6 +85,13 @@ summary = "execnet: rapid multi-Python deployment"
[package.dependencies]
apipkg = ">=1.4"
[[package]]
name = "future"
sections = ["doc"]
version = "0.18.2"
marker = "python_version >= \"3.5\""
summary = "Clean single-source support for Python 3 and 2"
[[package]]
name = "halo"
sections = ["default"]
......@@ -113,18 +120,25 @@ zipp = ">=0.5"
name = "incremental"
sections = ["dev"]
version = "17.5.0"
summary = "UNKNOWN"
summary = ""
[[package]]
name = "jinja2"
sections = ["dev"]
sections = ["dev", "doc"]
version = "2.11.1"
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2, 3.3, 3.4\""
marker = "python_version >= \"2.7\""
summary = "A very fast and expressive template engine."
[package.dependencies]
MarkupSafe = ">=0.23"
[[package]]
name = "livereload"
sections = ["doc"]
version = "2.6.1"
marker = "python_version >= \"3.5\""
summary = "Python LiveReload is an awesome tool for web developers"
[[package]]
name = "log-symbols"
sections = ["default"]
......@@ -134,13 +148,76 @@ summary = "Colored symbols for various log levels for Python"
[package.dependencies]
colorama = ">=0.3.9"
[[package]]
name = "lunr"
sections = ["doc"]
version = "0.5.6"
marker = "python_version >= \"3.5\""
summary = "A Python implementation of Lunr.js"
[package.dependencies]
future = ">=0.16.0"
six = ">=1.11.0"
[[package]]
name = "lunr"
sections = ["doc"]
version = "0.5.6"
extras = ["languages"]
marker = "python_version >= \"3.5\""
summary = "A Python implementation of Lunr.js"
[package.dependencies]
future = ">=0.16.0"
six = ">=1.11.0"
nltk = ">=3.2.5"
lunr = {marker = "python_version >= \"3.5\"", version = "==0.5.6"}
[[package]]
name = "markdown"
sections = ["doc"]
version = "3.2.1"
marker = "python_version >= \"3.5\""
summary = "Python implementation of Markdown."
[package.dependencies]
setuptools = ">=36"
[[package]]
name = "MarkupSafe"
sections = ["dev"]
sections = ["dev", "doc"]
version = "1.1.1"
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2, 3.3, 3.4\""
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2, 3.3\""
summary = "Safely add untrusted strings to HTML/XML markup."
[[package]]
name = "mkdocs"
sections = ["doc"]
version = "1.1"
marker = "python_version >= \"3.5\""
summary = "Project documentation with Markdown."
[package.dependencies]
click = ">=3.3"
Jinja2 = ">=2.10.1"
livereload = ">=2.5.1"
lunr = {extras = ["languages"], version = "==0.5.6"}
Markdown = ">=3.2.1"
PyYAML = ">=3.10"
tornado = ">=5.0"
[[package]]
name = "mkdocs-material"
sections = ["doc"]
version = "4.6.3"
summary = "A Material Design theme for MkDocs"
[package.dependencies]
mkdocs = ">=1.0"
Pygments = ">=2.4"
markdown = ">=3.2"
pymdown-extensions = ">=6.3"
[[package]]
name = "more-itertools"
sections = ["dev"]
......@@ -148,6 +225,13 @@ version = "8.2.0"
marker = "python_version >= \"3.5\""
summary = "More routines for operating on iterables, beyond itertools"
[[package]]
name = "nltk"
sections = ["doc"]
version = "3.4.5"
marker = "python_version >= \"3.5\""
summary = "Natural Language Toolkit"
[[package]]
name = "packaging"
sections = ["default", "dev"]
......@@ -197,6 +281,20 @@ version = "1.8.1"
marker = "python_version >= \"3.5\""
summary = "library with cross-python path, ini-parsing, io, code, log facilities"
[[package]]
name = "Pygments"
sections = ["doc"]
version = "2.5.2"
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2, 3.3, 3.4\""
summary = "Pygments is a syntax highlighting package written in Python."
[[package]]
name = "pymdown-extensions"
sections = ["doc"]
version = "6.3"
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2, 3.3, 3.4\""
summary = "Extension pack for Python Markdown."
[[package]]
name = "pyparsing"
sections = ["default", "dev"]
......@@ -299,18 +397,25 @@ six = "*"
packaging = "*"
vistir = {extras = ["spinner"], version = ">=0.4"}
[[package]]
name = "PyYAML"
sections = ["doc"]
version = "5.3"
marker = "python_version >= \"3.5\""
summary = "YAML parser and emitter for Python"
[[package]]
name = "setuptools"
sections = ["default"]
sections = ["default", "doc"]
version = "45.2.0"
marker = "python_version >= \"3.5\""
summary = "Easily download, build, install, upgrade, and uninstall Python packages"
[[package]]
name = "six"
sections = ["default", "dev"]
sections = ["default", "dev", "doc"]
version = "1.14.0"
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2\""
marker = "python_version >= \"2.7\""
summary = "Python 2 and 3 compatibility utilities"
[[package]]
......@@ -338,6 +443,13 @@ version = "0.5.8"
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2, 3.3\""
summary = "Style preserving TOML library"
[[package]]
name = "tornado"
sections = ["doc"]
version = "6.0.3"
marker = "python_version >= \"3.5\""
summary = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed."
[[package]]
name = "towncrier"
sections = ["dev"]
......@@ -425,8 +537,8 @@ summary = "Backport of pathlib-compatible object wrapper for zip files"
{file = "cached_property-1.5.1-py2.py3-none-any.whl", hash = "sha256:3a026f1a54135677e7da5ce819b0c690f156f37976f3e30c5430740725203d7f"},
]
"click 7.0" = [
{file = "Click-7.0-py2.py3-none-any.whl", hash = "sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13"},
{file = "Click-7.0.tar.gz", hash = "sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7"},
{file = "Click-7.0-py2.py3-none-any.whl", hash = "sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13"},
]
"colorama 0.4.3" = [
{file = "colorama-0.4.3-py2.py3-none-any.whl", hash = "sha256:7d73d2a99753107a36ac6b455ee49046802e59d9d076ef8e47b61499fa29afff"},
......@@ -480,6 +592,9 @@ summary = "Backport of pathlib-compatible object wrapper for zip files"
{file = "execnet-1.7.1-py2.py3-none-any.whl", hash = "sha256:d4efd397930c46415f62f8a31388d6be4f27a91d7550eb79bc64a756e0056547"},
{file = "execnet-1.7.1.tar.gz", hash = "sha256:cacb9df31c9680ec5f95553976c4da484d407e85e41c83cb812aa014f0eddc50"},
]
"future 0.18.2" = [
{file = "future-0.18.2.tar.gz", hash = "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"},
]
"halo 0.0.28" = [
{file = "halo-0.0.28-py3-none-any.whl", hash = "sha256:9adbfe0a23ae7198a17895aac8845685eb0abeaa13c6a56b60410b347d0f503a"},
{file = "halo-0.0.28.tar.gz", hash = "sha256:9ebf98b94a43f3b68e18c6d74dcb1ea58446b8457ce6fb1b2b4cac8d83733f80"},
......@@ -493,14 +608,31 @@ summary = "Backport of pathlib-compatible object wrapper for zip files"
{file = "incremental-17.5.0.tar.gz", hash = "sha256:7b751696aaf36eebfab537e458929e194460051ccad279c72b755a167eebd4b3"},
]
"jinja2 2.11.1" = [
{file = "Jinja2-2.11.1-py2.py3-none-any.whl", hash = "sha256:b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49"},
{file = "Jinja2-2.11.1.tar.gz", hash = "sha256:93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250"},
{file = "Jinja2-2.11.1-py2.py3-none-any.whl", hash = "sha256:b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49"},
]
"livereload 2.6.1" = [
{file = "livereload-2.6.1.tar.gz", hash = "sha256:89254f78d7529d7ea0a3417d224c34287ebfe266b05e67e51facaf82c27f0f66"},
{file = "livereload-2.6.1-py2.py3-none-any.whl", hash = "sha256:78d55f2c268a8823ba499305dcac64e28ddeb9a92571e12d543cd304faf5817b"},
]
"log-symbols 0.0.14" = [
{file = "log_symbols-0.0.14-py3-none-any.whl", hash = "sha256:4952106ff8b605ab7d5081dd2c7e6ca7374584eff7086f499c06edd1ce56dcca"},
{file = "log_symbols-0.0.14.tar.gz", hash = "sha256:cf0bbc6fe1a8e53f0d174a716bc625c4f87043cc21eb55dd8a740cfe22680556"},
]
"lunr 0.5.6" = [
{file = "lunr-0.5.6.tar.gz", hash = "sha256:7be69d7186f65784a4f2adf81e5c58efd6a9921aa95966babcb1f2f2ada75c20"},
{file = "lunr-0.5.6-py2.py3-none-any.whl", hash = "sha256:1208622930c915a07e6f8e8640474357826bad48534c0f57969b6fca9bffc88e"},
]
"lunr[languages] 0.5.6" = [
{file = "lunr-0.5.6.tar.gz", hash = "sha256:7be69d7186f65784a4f2adf81e5c58efd6a9921aa95966babcb1f2f2ada75c20"},
{file = "lunr-0.5.6-py2.py3-none-any.whl", hash = "sha256:1208622930c915a07e6f8e8640474357826bad48534c0f57969b6fca9bffc88e"},
]
"markdown 3.2.1" = [
{file = "Markdown-3.2.1.tar.gz", hash = "sha256:90fee683eeabe1a92e149f7ba74e5ccdc81cd397bd6c516d93a8da0ef90b6902"},
{file = "Markdown-3.2.1-py2.py3-none-any.whl", hash = "sha256:e4795399163109457d4c5af2183fbe6b60326c17cfdf25ce6e7474c6624f725d"},
]
"markupsafe 1.1.1" = [
{file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"},
{file = "MarkupSafe-1.1.1-cp27-cp27m-macosx_10_6_intel.whl", hash = "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161"},
{file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"},
{file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183"},
......@@ -533,12 +665,22 @@ summary = "Backport of pathlib-compatible object wrapper for zip files"
{file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42"},
{file = "MarkupSafe-1.1.1-cp38-cp38-win32.whl", hash = "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b"},
{file = "MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"},
{file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"},
]
"mkdocs 1.1" = [
{file = "mkdocs-1.1.tar.gz", hash = "sha256:9243291392f59e20b655e4e46210233453faf97787c2cf72176510e868143174"},
{file = "mkdocs-1.1-py2.py3-none-any.whl", hash = "sha256:1e385a70aea8a9dedb731aea4fd5f3704b2074801c4f96f06b2920999babda8a"},
]
"mkdocs-material 4.6.3" = [
{file = "mkdocs-material-4.6.3.tar.gz", hash = "sha256:1d486635b03f5a2ec87325842f7b10c7ae7daa0eef76b185572eece6a6ea212c"},
{file = "mkdocs_material-4.6.3-py2.py3-none-any.whl", hash = "sha256:7f3afa0a09c07d0b89a6a9755fdb00513aee8f0cec3538bb903325c80f66f444"},
]
"more-itertools 8.2.0" = [
{file = "more-itertools-8.2.0.tar.gz", hash = "sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507"},
{file = "more_itertools-8.2.0-py3-none-any.whl", hash = "sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c"},
]
"nltk 3.4.5" = [
{file = "nltk-3.4.5.zip", hash = "sha256:bed45551259aa2101381bbdd5df37d44ca2669c5c3dad72439fa459b29137d94"},
]
"packaging 20.1" = [
{file = "packaging-20.1-py2.py3-none-any.whl", hash = "sha256:170748228214b70b672c581a3dd610ee51f733018650740e98c7df862a583f73"},
{file = "packaging-20.1.tar.gz", hash = "sha256:e665345f9eef0c621aa0bf2f8d78cf6d21904eef16a93f020240b704a57f1334"},
......@@ -559,6 +701,14 @@ summary = "Backport of pathlib-compatible object wrapper for zip files"
{file = "py-1.8.1-py2.py3-none-any.whl", hash = "sha256:c20fdd83a5dbc0af9efd622bee9a5564e278f6380fffcacc43ba6f43db2813b0"},
{file = "py-1.8.1.tar.gz", hash = "sha256:5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa"},
]
"pygments 2.5.2" = [
{file = "Pygments-2.5.2.tar.gz", hash = "sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe"},
{file = "Pygments-2.5.2-py2.py3-none-any.whl", hash = "sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b"},
]
"pymdown-extensions 6.3" = [
{file = "pymdown-extensions-6.3.tar.gz", hash = "sha256:cb879686a586b22292899771f5e5bc3382808e92aa938f71b550ecdea709419f"},
{file = "pymdown_extensions-6.3-py2.py3-none-any.whl", hash = "sha256:66fae2683c7a1dac53184f7de57f51f8dad73f9ead2f453e94e85096cb811335"},
]
"pyparsing 2.4.6" = [
{file = "pyparsing-2.4.6-py2.py3-none-any.whl", hash = "sha256:c342dccb5250c08d45fd6f8b4a559613ca603b57498511740e65cd11a2e7dcec"},
{file = "pyparsing-2.4.6.tar.gz", hash = "sha256:4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f"},
......@@ -595,13 +745,26 @@ summary = "Backport of pathlib-compatible object wrapper for zip files"
{file = "pythonfinder-1.2.1-py2.py3-none-any.whl", hash = "sha256:cfbfe61b7bfc3b45b24f156e2bab76621ebc6ba92f69afbc16f76482d69d9802"},
{file = "pythonfinder-1.2.1.tar.gz", hash = "sha256:0a4f585abb76aa2fc97479cd12d10f7644aa1ab42b919747e04d33d7f9379425"},
]
"pyyaml 5.3" = [
{file = "PyYAML-5.3.tar.gz", hash = "sha256:e9f45bd5b92c7974e59bcd2dcc8631a6b6cc380a904725fce7bc08872e691615"},
{file = "PyYAML-5.3-cp27-cp27m-win32.whl", hash = "sha256:940532b111b1952befd7db542c370887a8611660d2b9becff75d39355303d82d"},
{file = "PyYAML-5.3-cp27-cp27m-win_amd64.whl", hash = "sha256:059b2ee3194d718896c0ad077dd8c043e5e909d9180f387ce42012662a4946d6"},
{file = "PyYAML-5.3-cp35-cp35m-win32.whl", hash = "sha256:4fee71aa5bc6ed9d5f116327c04273e25ae31a3020386916905767ec4fc5317e"},
{file = "PyYAML-5.3-cp35-cp35m-win_amd64.whl", hash = "sha256:dbbb2379c19ed6042e8f11f2a2c66d39cceb8aeace421bfc29d085d93eda3689"},
{file = "PyYAML-5.3-cp36-cp36m-win32.whl", hash = "sha256:e3a057b7a64f1222b56e47bcff5e4b94c4f61faac04c7c4ecb1985e18caa3994"},
{file = "PyYAML-5.3-cp36-cp36m-win_amd64.whl", hash = "sha256:74782fbd4d4f87ff04159e986886931456a1894c61229be9eaf4de6f6e44b99e"},
{file = "PyYAML-5.3-cp37-cp37m-win32.whl", hash = "sha256:24521fa2890642614558b492b473bee0ac1f8057a7263156b02e8b14c88ce6f5"},
{file = "PyYAML-5.3-cp37-cp37m-win_amd64.whl", hash = "sha256:1cf708e2ac57f3aabc87405f04b86354f66799c8e62c28c5fc5f88b5521b2dbf"},
{file = "PyYAML-5.3-cp38-cp38-win32.whl", hash = "sha256:70024e02197337533eef7b85b068212420f950319cc8c580261963aefc75f811"},
{file = "PyYAML-5.3-cp38-cp38-win_amd64.whl", hash = "sha256:cb1f2f5e426dc9f07a7681419fe39cee823bb74f723f36f70399123f439e9b20"},
]
"setuptools 45.2.0" = [
{file = "setuptools-45.2.0-py3-none-any.whl", hash = "sha256:316484eebff54cc18f322dea09ed031b7e3eb00811b19dcedb09bc09bba7d93d"},
{file = "setuptools-45.2.0.zip", hash = "sha256:89c6e6011ec2f6d57d43a3f9296c4ef022c2cbf49bab26b407fe67992ae3397f"},
{file = "setuptools-45.2.0-py3-none-any.whl", hash = "sha256:316484eebff54cc18f322dea09ed031b7e3eb00811b19dcedb09bc09bba7d93d"},
]
"six 1.14.0" = [
{file = "six-1.14.0-py2.py3-none-any.whl", hash = "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"},
{file = "six-1.14.0.tar.gz", hash = "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a"},
{file = "six-1.14.0-py2.py3-none-any.whl", hash = "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"},
]
"spinners 0.0.23" = [
{file = "spinners-0.0.23.tar.gz", hash = "sha256:f396fea1ee00c0622988d7d2bf2895d26dd6f70850ca2ce94eaca52ca4873560"},
......@@ -617,6 +780,15 @@ summary = "Backport of pathlib-compatible object wrapper for zip files"
{file = "tomlkit-0.5.8-py2.py3-none-any.whl", hash = "sha256:96e6369288571799a3052c1ef93b9de440e1ab751aa045f435b55e9d3bcd0690"},
{file = "tomlkit-0.5.8.tar.gz", hash = "sha256:32c10cc16ded7e4101c79f269910658cc2a0be5913f1252121c3cd603051c269"},
]
"tornado 6.0.3" = [
{file = "tornado-6.0.3.tar.gz", hash = "sha256:c845db36ba616912074c5b1ee897f8e0124df269468f25e4fe21fe72f6edd7a9"},
{file = "tornado-6.0.3-cp35-cp35m-win32.whl", hash = "sha256:c9399267c926a4e7c418baa5cbe91c7d1cf362d505a1ef898fde44a07c9dd8a5"},
{file = "tornado-6.0.3-cp35-cp35m-win_amd64.whl", hash = "sha256:398e0d35e086ba38a0427c3b37f4337327231942e731edaa6e9fd1865bbd6f60"},
{file = "tornado-6.0.3-cp36-cp36m-win32.whl", hash = "sha256:4e73ef678b1a859f0cb29e1d895526a20ea64b5ffd510a2307b5998c7df24281"},
{file = "tornado-6.0.3-cp36-cp36m-win_amd64.whl", hash = "sha256:349884248c36801afa19e342a77cc4458caca694b0eda633f5878e458a44cb2c"},
{file = "tornado-6.0.3-cp37-cp37m-win32.whl", hash = "sha256:559bce3d31484b665259f50cd94c5c28b961b09315ccd838f284687245f416e5"},
{file = "tornado-6.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:abbe53a39734ef4aba061fca54e30c6b4639d3e1f59653f0da37a0003de148c7"},
]
"towncrier 19.2.0" = [
{file = "towncrier-19.2.0-py2.py3-none-any.whl", hash = "sha256:de19da8b8cb44f18ea7ed3a3823087d2af8fcf497151bb9fd1e1b092ff56ed8d"},
{file = "towncrier-19.2.0.tar.gz", hash = "sha256:48251a1ae66d2cf7e6fa5552016386831b3e12bb3b2d08eb70374508c17a8196"},
......@@ -647,5 +819,5 @@ summary = "Backport of pathlib-compatible object wrapper for zip files"
]
[root]
content_hash = "md5:a97a2069aa52f7be46a0f4e40c0937ad"
content_hash = "md5:6d0678b224441c7ed23a4b55635634aa"
meta_version = "0.0.1"
from __future__ import annotations
import hashlib
import json
import re
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union
......@@ -207,8 +208,8 @@ class Project:
toml_section = (
"dependencies" if section == "default" else f"{section}-dependencies"
)
dump_data[toml_section] = self.tool_settings.get(toml_section)
pyproject_content = tomlkit.dumps(dump_data)
dump_data[toml_section] = dict(self.tool_settings.get(toml_section, {}))
pyproject_content = json.dumps(dump_data, sort_keys=True)
hasher = hashlib.new(algo)
hasher.update(pyproject_content.encode("utf-8"))
return hasher.hexdigest()
......
......@@ -40,6 +40,10 @@ towncrier = "<20.0.0,>=19.2.0"
pytest-sugar = "<1.0.0,>=0.9.2"
pytest-xdist = "<2.0.0,>=1.31.0"
[tool.pdm.doc-dependencies]
mkdocs = "<2.0.0,>=1.1"
mkdocs-material = "<5.0.0,>=4.6.3"
[tool.pdm.cli]
pdm = "pdm.cli.commands:cli"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册