I have a simple question.
I used to create a poetry project with my package at root.
project.toml
mypackage
+- __init__.py
+- mypackage.py
+- test_mypackage.py
I recently moved my tests in another directory, so that the folder now looks like.
project.toml
src
+- mypackage
+- __init__.py
+- mypackage.py
tests
+- test_mypackage.py
Nothing changed for poetry which still work fine when I make poetry build
. How does it search for the package root folder? Does it serach a folder with the package name in project.toml
?
Thanks for your help.
Having a folder called src
to contain the package code is just a pre-defined standard that poetry
recognizes without being told. It works via the packages
section in your project file, which by default scans for mypackage
and src/mypackage
. If you provide your own value, it will stop auto-detecting those two.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With