Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests to the repository root level #13

Open
zerolab opened this issue Oct 20, 2021 · 3 comments
Open

Move tests to the repository root level #13

zerolab opened this issue Oct 20, 2021 · 3 comments

Comments

@zerolab
Copy link
Collaborator

zerolab commented Oct 20, 2021

I don't thing there's any need to bundle them in the built package. Smaller package sizes == happier devs and planet.

Dev reference: https://hynek.me/articles/testing-packaging/ | https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure

Project structure:

src/
╰─ project_name/
   ╰─ ...
tests/
╰─ ...

<configuration files etc>
@kaedroho
Copy link
Contributor

kaedroho commented Feb 7, 2022

This sounds good to me!

Don't forget to update https://github.com/wagtail/cookiecutter-wagtail-package/blob/main/wagtail-%7B%7B%20cookiecutter.project_name_kebab%20%7D%7D/setup.py#L23 to prevent the tests folder being packaged up an installed as a global "tests" app (which might conflict with the test suite of draftjs_exporter which does this).

@zerolab
Copy link
Collaborator Author

zerolab commented Feb 7, 2022

yep, that's what we do on wagtailmedia - https://github.com/torchbox/wagtailmedia/blob/main/setup.py#L37-L38

@zerolab
Copy link
Collaborator Author

zerolab commented Apr 24, 2024

Test were moved to the root level. Now to move package_name to src/package_name so it is never a top level import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants