-
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
How are you supposed to install optionals? #426
Comments
Optional dependencies can only be opted-in by using extras, yes. And regarding |
I was able to get black working (i had to set However, I'm unable to get ipdb installed using
|
This doesn't help for installing these packages with pip though on the consumer side. You would have to produce a 'requirements.txt' with named extras like in PEP 508. |
EDIT I've submitted a PR that fixes the issue. I have the same (or similar) issue:
[tool.poetry]
name = "mything"
version = "0.1.0"
description = "description"
authors = ["nick"]
[tool.poetry.dependencies]
python = "^3.6 || ^3.7"
[tool.poetry.dev-dependencies]
pytest = "^3"
black = { version = "^18.9b0", optional = true }
mypy = { version = "^0.641.0", optional = true }
typing-extensions = { version = "^3.6", optional = true }
[tool.poetry.extras]
developer = ["black", "mypy", "typing-extensions"] When I run
When I run
The packages When I run
and
HOWEVER, I found a manual fix. When I look at [extras]
developer = [] When I change that list to: [extras]
developer = ["mypy", "black", "typing-extensions"] and run
and It seems the initial extras are not being written to the lock file when the dependencies appear as part of When I move the requirements from
I believe this is a bug. We should be able to define extras that depend on packages only in |
* Ensures that all requirements, whether from dependencies or dev-dependencies for extra targets are written to the lockfile. * Fixes python-poetry#426
* Ensures that all requirements, whether from dependencies or dev-dependencies for extra targets are written to the lockfile. * Fixes python-poetry#426
Like I said in the associated PR this is not something that will be supported for the reasons explained here: #606 (comment) |
As it appears to be the case that the use of extras is required for all optional dependencies in order in order to be able to opt-in, I think the phrasing of this comment in the docs at https://python-poetry.org/docs/pyproject/ need to be changed. Note the word "some", which implies "not all".
It's confusing at best. |
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
I've got something similar to poetry's pyproject.toml file.
You can see my file here:
aiohttp_session_ws
The problem is, now that
black
is optional, I can't get it to install. Should I only be usingoptional
for packages that are "extras". And if so, why doesn'tpoetry install -E development
then install black?The text was updated successfully, but these errors were encountered: