-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Feature Request / Bug Report
Foreword
While I took a look at #2457 and tried to implement it #2511 I encountered an breaking issue: You cannot install poetry from source directly.
I stated my findings and thoughts in the comments of the issue yesterday. But I think its better to outsource this discussion into another (this) issue because its off-topic for the other issue.
Quotes in the following text are either from my above linked comment or this issue itself.
The Issue
So first of all the encountered issue is not a problem if you install poetry like its described in the docs.
The problem occurs when you want to install poetry from source with pip install .:
When I clone the poetry repo I cannot install it via
pip install .like pre-commit will do. For installing it it wants to build a wheel for poetry but fails so because for building it it wants to use itself but its dependencies are not there because its not installed - catch-22.
For the error output please see the spoiler in my linked comment. You can also simply reproduce the error when you clone the repo and install it into a venv (linux commands):
git clone https://github.com/python-poetry/poetry
python3 -m venv venv
source venv/bin/activate
pip install -U pip
pip install .Solutions
I stated 3 solutions:
- Bootstrapping (I think its called): change from using itself to using poetry as a package (like we all do)
- add the install dependencies to the
requiressection in[build-system]inpyproject.toml- include dependencies in poetry repo itself
And said:
I think option 2 and 3 are overhead and IMO option 1 is the solution.
So after a night of sleep I got some additional thoughts and changed my view on my statement from above. Now I think solution 1 would only be the best temporary solution to the problem (because its so easy to apply and can be changed back anytime).
IMO the best and most stylish approach would be solution 2 but only in conjunction with the following part.
Implementation
Before I talk further I want to state that till now I have not taken a single look into the internals of poetry and plan to do so. So please don't hit me 😉
poetry currently has 22 install dependencies (4 for py3.4 (drop in 1.1) and 6 for py2.7 (drop in 2.0)). I don't think all are necessary to use poetry as a building back-end.
So I think it would be best to not put all dependencies into the require section but allow poetry to be used in a minimal way with minimal dependencies as a building back-end to build the full poetry application from source.
Proposal
I would propose to implement solution 1 as a temporary fix first
(because its so easy to apply and can be changed back anytime)
and then implement solution 2 like state above.
What do you think?
EDIT: Added context to dependency amount