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

BUG: tests module is included in distribution #22

Open
jamesmyatt opened this issue Feb 22, 2021 · 1 comment
Open

BUG: tests module is included in distribution #22

jamesmyatt opened this issue Feb 22, 2021 · 1 comment

Comments

@jamesmyatt
Copy link
Contributor

jamesmyatt commented Feb 22, 2021

In conda, I get the following error:

ClobberError: This transaction has incompatible packages due to a shared path.
  packages: conda-forge/noarch::pyprojroot-0.2.0-py_0, conda-forge/noarch::shtab-1.3.4-pyhd3deb0d_0
  path: 'lib/site-packages/tests/__init__.py'

This suggests that this package is distributing a module called tests, which is wrong.

I assume that the same problem will occur with pip too.

In my experience, the best solution is a src layout as described in https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure and https://hynek.me/articles/testing-packaging/#src.

It's also worth noting that the "tests outside application code" pattern usually doesn't make the tests directory into a module: https://docs.pytest.org/en/latest/goodpractices.html?highlight=src#tests-outside-application-code. Note that this good practice guide also strongly suggests a src layout.

@chendaniely chendaniely mentioned this issue Mar 29, 2021
5 tasks
chendaniely added a commit that referenced this issue Mar 29, 2021
chendaniely added a commit that referenced this issue Mar 30, 2021
@jamesmyatt
Copy link
Contributor Author

That looks OK. It just needs to be released 👍

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

1 participant