-vvv option).I have the following layout on disk
ββmy_project
β ββ pyproject.toml
| ββ ...
| ββ .git/
|
ββgit_clone_of_some_library
ββ setup.py
ββ ...
ββ .git/
git_clone_of_some_library/setup.py contains:
from setuptools import find_packages, setup
...
setup(
...
install_requires=[
...
],
extras_require=dict(
dev=[
'a_dev_only_library_not_available_in_my_current_context',
...
]
),
...
)
So, I'm trying to set up my environment with:
my_project $ poetry install
my_project $ poetry add --path=../git_clone_of_some_library git_clone_of_some_library
But I get:
[SolverProblemError]
Because git_clone_of_some_library (x.y.z) depends on a_dev_only_library_not_available_in_my_current_context (*) which doesn't match any versions, git_clone_of_some_library is forbidden.
So, because my_project depends on git_clone_of_some_library (...), version solving failed.
What I don't understand is why a package in the [dev] extra is being installed?
That seems like a bug, but it also raises the question: if I want to specify one or more extras when adding a library as a dependency, how do I do that?
π€ hmmm, this sounds a lot like #551 and was fixed in 0.12.5. Maybe it is different in this case because it's being installed from a local path.
yeah, I'm looking for the equivalent of pip install -e ../git_clone_of_some_library git_clone_of_some_library, which is what I used to do. Should I be doing something else?
(I really want the 'editable' bit, I don't want to have to re-run poetry install every time I make a change in git_clone_of_some_library git_clone_of_some_library...)
@stefanfoulis your case is a little bit different due to markers presence.
This bug is from here https://github.com/sdispater/poetry/issues/425#issuecomment-431678068, and I hope it will be resolved soon.
@cjw296
I really want the 'editable' bit
Maybe, poetry install with --develop will help you.
Most likely poetry install --develop=git_clone_of_some_library, dependency should be added first.
if I want to specify one or more extras when adding a library as a dependency, how do I do that?
poetry add --extras=a --extras=b --path=../git_clone_of_some_library git_clone_of_some_library
@narimanizett - poetry install is targeting the "main project" though, no? I want to install a third-party library from a local directory for use with my project (almost the same as if it was a git clone of that library's master branch...).
Now, you've also shown how to add a path where I do want extras, but this bug is the case where I don't want extras... How do I do that?
Now, you've also shown how to add a path where I _do_ want extras, but this bug is the case where I _don't_ want extras... How do I do that?
While this bug exists -- you can't do that :)
But, a clear way to do that - just to not specify any extras (it worked before #425 was fixed).
I have not found a workaround for this, except for the way to satisfy deps versions, defined in the extras.
poetry installis targeting the "main project" though, no? I want to install a third-party library from a local directory for use with my project (almost the same as if it was a git clone of that library's master branch...).
?
poetry install installs all the dependencies of your project, as defined in poetry.lock.
It installs your project as well in editable mode (just for convenience).
So, you need to add your git clone as a dependency of the main project via poetry add (which is not work for you by now due to that bug with extras...), and then run poetry install with the name of your git clone package in --develop option.
poetry add --path=../git_clone_of_some_library actual-name-of-package
poetry install --develop=actual-name-of-package
Sorry, if I misunderstood the question.
Poetry will also lock the extras of a dependency, unless they are not compatible with the current project, even if you do not require them.
The reason for that is to avoid conflicts later on if you choose to activate extras.
I know this might not be ideal in some cases but, for now, this is a limitation of the resolver. I will take a look to see if I can improve this somehow.
@sdispater - I'm afraid this is quite incorrect :-( Extras shouldn't even be installed, let alone locked, unless explicitly requested. Unfortunately, for one big project I was hoping to use poetry this, this makes it a non-starter until this bug is resolved...
@narimanizett - can you specify multiple packages to --develop?
@cjw296, yes, you can. Repeat --develop as many times as you need.
--develop=a --develop=b
On Mon, Nov 5, 2018, 09:02 Chris Withers notifications@github.com wrote:
@narimanizett https://github.com/narimanizett - can you specify
multiple packages to --develop?β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/sdispater/poetry/issues/592#issuecomment-435773464,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFudnxPNO-zKGYZIT9H0dwLHa-Y5MHMQks5ur-J8gaJpZM4YLwH-
.
Cool, now just need to get this bug fixed ;-)
This should be fixed in the latest 0.12.7 release.
Nice! Thank you for the speedy fix :-)