Installing directory poetry package with dependencies in secondary source fails
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- MacOS 10.14:
- 1.0.0b8:
Issue
Due to https://github.com/pypa/pip/issues/7444 installing a directory which is managed by poetry or has a pyproject.toml file present will cause the --no-deps
argument to be ignored.
This can go unnoticed as long as you are only working with pypi dependencies but when your package depends on a private pypi repository this causes installs to fail.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Installing directory poetry package with dependencies in secondary ...
Installing directory poetry package with dependencies in secondary source fails.
Read more >Dependency Management With Python Poetry
Learn how Python Poetry will help you start new projects, maintain existing ones, and master dependency management.
Read more >python - Poetry trying to install everything from private repository
poetry first checks if the project is in your private-pypi and then checks public-pypi . Here the error is mostly because of 403...
Read more >Dependency specification | master | Documentation - Poetry
Dependency specification Dependencies for a project can be specified in various forms, which depend on the type of the dependency and on the...
Read more >Managing Python Dependencies with Poetry
And this rings the bell of good and solid unit testing. If you fail to create a solid test suite that would eventually...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok many many hours later I have sorted out the behaviour of PEP 517 and PEP 518 and what its going on here causing the problem.
I don’t know the full implications, but here is the issue
https://github.com/sdispater/poetry/blob/e943a4e127b0a658e76386006c60b79954a8fa57/poetry/masonry/api.py#L21-L29
And here is the snippet from pip
Basically at this point, pip has gone into the build isolation and poetry has been retrieved and installed. pip then queries poetry and asks “what else is required for me to build this wheel”. To which poetry is responding with the dependencies of the package.
I do not know enough about packaging, but I think returning all the dependencies is a mistake. The build system doesn’t need my dependencies to package up my wheel, I only need it to use the wheel.
I have been able to test this out hacking at pip to be the following:
By doing this none of my dependencies are installed and the wheel is generated and installed the way I expect.
I don’t know how this impact C extensions or if those are even supported with poetry right now but I think that
get_requires_for_build_wheel(config_settings=None)
should be modified to return an empty list. That is all that is required to build the wheel, poetry and nothing else.Looks good now to me as its the same hack I have been running for a month now.
Thanks for providing a proper fix for it. I will close our my old hacky PR.