Open hhstore opened 11 months ago
pyenv
+ poetry
. 基本够用. Rye
, 已经比较成熟. PDM
, 各种不完善 & bug.(始终不喜欢) Poetry + Pyenv
: 依然是当前(2023-12
)首选.Rye
: 当前不推荐, 和 Mojo
有干扰, 懒的排雷.(不如 poetry + pyenv)PDM
: 不如 Poetry new project
方便, 虽然支持 pdm init --copier xxx
方式, 但不想用.
go-task
, 也一样有.PS:
cargo(rust)
比, 都是半吊子, 各有各的残废.(还是别浪费时间了, 等 Mojo 吧)
pip install pipx
pipx install pdm[all]
curl -sSL https://pdm-project.org/install-pdm.py | python3 -
brew install pdm
pdm add requests # add requests
pdm add requests==2.25.1 # add requests with version constraint
pdm add requests[socks] # add requests with extra dependency
pdm add "flask>=1.0" flask-sqlalchemy # add multiple dependencies with different specifiers
# 本地包:
pdm add ./sub-package
pdm add ./first-1.0.0-py2.py3-none-any.whl
# 基于 URL:
# Install gzipped package from a plain URL
pdm add "https://github.com/numpy/numpy/releases/download/v1.20.0/numpy-1.20.0.tar.gz"
# Install wheel from a plain URL
pdm add "https://github.com/explosion/spacy-models/releases/download/en_core_web_trf-3.5.0/en_core_web_trf-3.5.0-py3-none-any.whl"
pdm add -dG test pytest
# 开发分组:
# A relative path to the directory
pdm add -e ./sub-package --dev
# A file URL to a local directory
pdm add -e file:///path/to/sub-package --dev
# A VCS URL
pdm add -e git+https://github.com/pallets/click.git@main#egg=click --dev
[tool.pdm.dev-dependencies]
lint = [
"flake8",
"black"
]
test = ["pytest", "pytest-cov"]
doc = ["mkdocs"]
[tool.pdm.scripts]
start = {cmd = [
"flask",
"run",
# Important comment here about always using port 54321
"-p", "54321"
]}
pdm init --cookiecutter gh:cjolowicz/cookiecutter-hypermodern-python
# or
pdm init --copier gh:pawamoy/copier-pdm --UNSAFE
1
1
1
1
📖 Abstract:
💯 Related: