Hatchling插件,用于从requirements.txt读取项目依赖项
项目描述
Hatchling插件,用于从requirements.txt读取项目依赖项
测试 |
|
---|---|
PyPI |
|
Anaconda |
|
活动 |
|
QA |
|
其他 |
使用说明
在你的 pyproject.toml 中进行以下更改
将 hatch-requirements-txt 添加到 build-system.requires。
将 "dependencies" 添加到 project.dynamic。
添加以下表格
[tool.hatch.metadata.hooks.requirements_txt]
files = ["requirements.txt"]
生成的 pyproject.toml 应该看起来像
[build-system]
requires = ["hatchling", "hatch-requirements-txt"]
build-backend = "hatchling.build"
[project]
name = "my-project"
version = "1.0.0"
dynamic = ["dependencies"]
[tool.hatch.metadata.hooks.requirements_txt]
files = ["requirements.txt"]
您还可以通过将 optional-dependencies 添加到 project.dynamic 并添加一个类似表格来定义可选依赖项组(也称为“功能”)
[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
crypto = ["requirements-crypto.txt"]
fastjson = ["requirements-fastjson.txt"]
cli = ["requirements-cli.txt"]
需求文件格式
hatch-requirements-txt 仅支持 pip 所支持的 requirements.txt 格式 的子集。以下是被支持的:
需求指定,按照 PEP 508 规范。
注释,以 # 开头。
--<option> 选项,可以单独一行,也可以在需求指定器之后。但请注意,这些选项本身是被忽略的。
以下在 requirements.txt 文件中不被支持:
带有 -e 选项的可编辑安装命令,
使用 -r 或 -c 选项引用其他需求或约束文件。
引用本地文件系统上的路径或 URL。
TL;DR 为了最佳兼容性,请确保您的 requirements.txt 文件中的所有行都是有效的 PEP 508 需求,或者以 # 开头的注释。
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。
源分布
hatch_requirements_txt-0.4.1.tar.gz (6.5 kB 查看哈希值)
构建分布
关闭
hatch_requirements_txt-0.4.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 2c686e5758fd05bb55fa7d0c198fdd481f8d3aaa3c693260f5c0d74ce3547d20 |
|
MD5 | bb741f92af054815f851f0d9333dd51b |
|
BLAKE2b-256 | 7c043703d3caa354fd7148a5453724de70577a6010234d1e1f3ff6b98a4d3242 |
关闭
hatch_requirements_txt-0.4.1-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 13c6ab7707cbc0aba128b3626dacae4be7065f1dbafc792461c9f547b3c3ffde |
|
MD5 | 60ccd367bf00e9f29c847b8dc9c51732 |
|
BLAKE2b-256 | 98a39a71667d284dff0e5d1c95b99b2383bbfcfc120843209522f8054055c0bb |