最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Use dynamic optional dependencies pyproject.toml - Stack Overflow

programmeradmin1浏览0评论

I want to create a pip package, which installs both module1 and module2 when doing a pip install ., but by doing a pip install .[module1] only installs dependencies from module1/module1_requirements.txt. I tried the following approach, but this will install also module2 dependencies for pip install .[module1] Is there a way to achieve this without using a separate setup.py or an all group?

requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
requires-python = ">=3.9"
name = "foobar"
dynamic = ["dependencies", "optional-dependencies"]

[tool.setuptools.dynamic]
dependencies = { file = ["module1/module1_requirements.txt", "module2/module2_requirements.txt"] }
optional-dependencies.module1 = { file = ["module1/module1_requirements.txt"] }
optional-dependencies.module2 = { file = ["module2/module2_requirements.txt"] }
发布评论

评论列表(0)

  1. 暂无评论