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

I want to create a pip package, which installs both module1 and module2 when doing a pip install ., but

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"] }

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744620652a4584323.html

相关推荐

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

    I want to create a pip package, which installs both module1 and module2 when doing a pip install ., but

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信