cookiecutter-pytest-plugin icon indicating copy to clipboard operation
cookiecutter-pytest-plugin copied to clipboard

Use src layout

Open danmur opened this issue 6 years ago • 2 comments

Thank you for the very handy template! Just a curiosity I guess, I created my package, pytest-blah, and there's a source file in the root (pytest_blah.py) along with setup.py etc. When I run python setup.py develop the root containing these files is added to my path, so I can do things like import setup or import pytest_blah directly (I've tried this from outside the root so it's not just a current directory thing).

Have I done something wrong or is that how it's supposed to be? Seems weird to have things like setup.py importable when the package is installed. I ended up making a pytest_blah directory, moving everything from pytest_blah.py into pytest_blah/init.py and putting all the other source files in there and it works as I expect.

EDIT: short example of what I mean: https://gist.github.com/danmur/0489969229281165424b0044f4236b92

danmur avatar Jun 02 '18 09:06 danmur

Yeah, using a src-layout, i.e. everything below src/ is best practice nowadays.

blueyed avatar Oct 21 '19 05:10 blueyed

See #38

hackebrot avatar Oct 21 '19 12:10 hackebrot

Fixed by #61

bluetech avatar Jan 19 '24 12:01 bluetech