linkml / linkml-project-cookiecutter

A cookiecutter for linkml projects. An equivalent of `linkml-ws new project-name`.
Creative Commons Zero v1.0 Universal
14 stars 16 forks source link

Unnecessary and confusing nesting of poetry projects #74

Closed jonathanunderwood closed 7 months ago

jonathanunderwood commented 9 months ago

The instructions given in the README mean that you end up creating twopoetry virtual environments, one of which is created from running poetry inside the first poetry virtual environment. This appears to be done under the assumption that the user wants to have a number of linkml projects underneath a single linkml projects folder.

Another assumption is that the user will run Makefile commands with a pre-activated poetry shell (i.e. poetry shell). I don't think this is how most users use poetry - observing how people use poetry, they tend to not activate the shell and then run commands, but instead use poetry run ....

My recommendation is that this set of instructions is redesigned to focus on the simpler use case of "I want to create a single linkml project in a folder, and I want to run make without first activating a poetry shell". The latter part would be achieved by having the Makefile commands prefixed with poetry run as appropriate.

dalito commented 7 months ago

This nesting is not "unnecessary" but required to isolate the environments for the installation tooling from the created linkml-project. But I agree that it is a bit confusing.

If presence of pipx could be assumed, the instructions in Step 1 & 2 would reduce to pipx install poetry, pipx install cruft. This would be much simpler and avoid the confusion.

In my opinion it is good a advice to have pipx on the system when you work with Python but am not sure if I am part of a minority. pipx has worked great for me since years on Windows & Linux.

pkalita-lbl commented 7 months ago

With https://github.com/linkml/linkml-project-cookiecutter/pull/84 the instructions have been rewritten to advise using pipx and not have the nested Poetry projects.