14

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.

emonier
  • 293
  • 1
  • 3
  • 13

1 Answers1

10

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.

Arne
  • 17,706
  • 5
  • 83
  • 99