-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically add extras entry for --optional #772
Comments
@xsduan that result in something like this, right? [tool.poetry.dependencies]
python = ">=3.6"
requests = {version = "^2.21",optional = true}
[tool.poetry.extras]
https-loader = ["requests"] |
here is my example: when I add gunicorn to deploy extras via $ cat pyproject.toml
[tool.poetry]
name = "..."
version = "0.1.0"
description = ""
authors = ["..."]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.6"
uvicorn = "^0.7.1"
wsproto = "^0.14.0"
gunicorn = {version = "^19.9",optional = true,extras = ["deploy"]}
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api" As we see extras is in attribute, not in section and I think it's a bug. When run install $ poetry install -E deploy
Installing dependencies from lock file
[ValueError]
Extra [deploy] is not specified.
install [--no-dev] [--dry-run] [-E|--extras EXTRAS] [--develop DEVELOP] |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Question
So it took a while and 4 tries, but apparently to add extras you have to both do
poetry add lib --optional
and add a field in[tool.poetry.extras]
as a list of dependencies for each group. It would be nice if the default behavior of poetry add lib --optional would either add a field in the extras section automatically or suggest adding a field into extras (like "to add as an extra, addlib = ["lib"]
to [tool.poetry.extras]" or something), or at a minimum have a section in the docs on how to have "extras".edit: nvm the extras does describe how to add, but i'd still like to have an cli option to add a new section automatically when
add --optional
(likeadd --peer
?)The text was updated successfully, but these errors were encountered: