使用pip-deepfreeze锁定hatch环境
项目描述
hatch-pip-deepfreeze
一个hatch虚拟环境插件,用于使用pip-deepfreeze锁定依赖项。
安装
hatch-pip-deepfreeze
必须与hatch
本身安装在同一环境中。
如果使用pipx
安装了hatch
pipx runpip hatch install hatch-pip-deepfreeze
如果使用pip
在用户环境中安装了hatch
pip install --user hatch-pip-deepfreeze
使用方法
在tool.hatch.envs.{name}
部分,添加type = "pip-deepfreeze"
。此类环境的行为类似于标准的hatch virtual
环境,但安装和同步是使用pip-deepfreeze sync
执行的。
这将自动在requirements.txt
中生成锁定依赖项,并在从pyproject.toml
中移除它们后卸载不必要的依赖项。它还在requirements-{extra}.txt
中固定可选依赖项组。
您可以使用features
在环境中安装project.optional-dependencies
。
请注意,此插件不支持每个环境的dependencies
,因为pip-deepfreeze
仅与那个的project.optional-dependencies
一起使用。幸运的是,这得到了hatch
的良好支持。
例如,您可以修改由hatch new
生成的pyproject.toml
如下
声明测试的依赖项
[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
]
更新默认环境部分以删除dependencies
并添加features
[tool.hatch.envs.default]
type = "pip-deepfreeze"
features = ["test"]
使用通常的hatch
环境激活功能,如hatch shell
,并注意pip-deepfreeze
正在执行。
许可证
hatch-pip-deepfreeze
遵循MIT许可证条款进行分发。
项目详情
关闭
hatch_pip_deepfreeze-0.2.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 184ead26322ee36d46a18ae66dadb8aab74ba58b552bfd84507066cd0bc21205 |
|
MD5 | d77a90e294316b3a541a11c1d97133d4 |
|
BLAKE2b-256 | fb50bca36a9ffe43fb764515c076b9335b65347ed4c56c1792b6b9ad61e129ba |
关闭
hatch_pip_deepfreeze-0.2-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | f2e749d6371b1e7ce3d90edae49361d70f0d7eb4897fd213ec7378826592078f |
|
MD5 | 726efeecbb2ecad817073341245a3fe3 |
|
BLAKE2b-256 | 0fec4528a7d1273bf9adeefe121ba9765d413857959b3f99fc254f2ed27f1ecc |