pyproject.toml option equivalent to "--no-root"
See original GitHub issue- 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
Can we add an option to the pyproject.toml
or poetry.toml
that defaults poetry
to using the install --no-root
behaviour by default, the fact I’m constantly having to run poetry install --no-root
almost every time (I honestly cant recall a time I haven’t used this… so for me its close to always) rather than poetry install
makes this feel like something I should be able to configure.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:43
- Comments:39 (10 by maintainers)
Top Results From Across the Web
Basic usage | Documentation | Poetry - Python dependency ...
The pyproject.toml file is what is the most important here. This will orchestrate your project and its dependencies. For now, it looks like...
Read more >Implementing dependency management with Python Poetry
Poetry creates two files for the project: pyproject.toml and poetry.lock ... from installing your local project, use the '--no-root' option.
Read more >A Practical Guide to Setuptools and Pyproject.toml
An example driven guide to setting up and building a python package using Setuptools together with pyproject.toml.
Read more >Integrating Python Poetry with Docker - Stack Overflow
Also, pin this version in your pyproject.toml as well: ... It is already isolated. So, we use poetry config virtualenvs.create false setting to...
Read more >Python Poetry Cheat Sheet - YippeeCode
If you are familiar with pip package manager then this is similar to ... Update all poetry packages that are defined in pyproject.toml...
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 Free
Top 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
please make --no-root default
I’d argue this option actually belongs in both
poetry.toml
andpyproject.toml
since a developer wanting to control their personal environment should usepoetry.toml
as this is their local config for their environments, however if a project were to for some reason require this option, then it makes sense for them to have this in thepyproject.toml
that will be checked into git and shared with other developers.One reason why a project might require this option is the popular testing tool Tox. Currently
tox
andpoetry
don’t play very well together, the current best practice recommends using--no-root
in thetox
configuration files. I wont reiterate the entire history of these other issues, but https://github.com/python-poetry/poetry/issues/1941 does a good job of summarising.Another is Docker builds. https://github.com/python-poetry/poetry/issues/2760 and https://github.com/python-poetry/poetry/issues/1879 cover various issues in Docker environments where
--no-root
has come up as either the solution or a potential solution.This is doubly problematic in the case of a web based project deployed using docker and tested with tox, where there is potentially (I’d argue this is quite likely) no scenario where the developers actually want to “install” the code they are writing and then the test setup will cause problems, in this situation there is no reason to ever install “the package” at all and forcing this as default behaviour only causes problems by constantly requiring users of
poetry
to use the--no-root
option to avoid problems. I don’t come across many Flask or Django tutorials that even suggest a user define their code as an installable package at all so many web based projects are not written with installation as a package in mind. It was a Django package where I was testing using Tox that I had the most issues with poetry. Compounded with issues related to namespaced packages and having parts of the namespaced package in different pythonpath locations I got very frustrated with having to constantly use--no-root
and opened this issue.There are definitely legitimate uses for having a config file option for always doing the same thing as
--no-root
and it likely belongs inpyproject.toml
but once theres an option for this I don’t see any reason why it shouldn’t also be a personal preference option onpoetry.toml
, but I’m less bothered by that not being available than I am at the lack of a project specific option for when this is necessary.