Improve error message for packages in src folder#800
Improve error message for packages in src folder#800martinvotruba-r7 wants to merge 3 commits intopython-poetry:mainfrom
Conversation
First thought: This should be part of Second thought: Somewhere we do check if referenced readme files do exist. That is something similar. Maybe, we should put this check at the same place. We do the readme check in the Doing it in the check command means you will only get the warning when running Considering the similarity to the readme check, I think I prefer to move it into the |
|
@radoering I have moved the implementation into the suggested |
Problem description
Currently when a
poetry installcommand is run on a project, which has source stored undersrc/project_name, but a folder namedproject_nameexists in the root, the command will fail withproject_name is not a package.It can be rather hard to determine the root cause, as one might easily overlook the empty folder.Steps to reproduce
poetry new poetry-demopoetry_demo/__init__.pytosrc/poetry_demo/__init__.pypoetry installThe command will fail with the following
This is caused by the presence of poetry_demo folder in the root.
When I remove the poetry_demo folder, the
poetry installcommand succeeds.Resolution
To provide more information about the actual root cause of the issue, I have added another validation method to the Factory class. This will output a warning when there is both
project_namefolder in the rootsrc/project_namefolderThe provided warning message is the following
If there is a better place / method how to alert user to the empty
project_namefolder, I am happy to hear it and adjust my implementation.