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 #30

Closed
jamesmyatt opened this issue Feb 22, 2021 · 1 comment · Fixed by #31
Closed

BUG: tests module is included in distribution #30

jamesmyatt opened this issue Feb 22, 2021 · 1 comment · Fixed by #31
Assignees
Labels
p0-critical Max priority (ASAP) testing Unit tests & debugging

Comments

@jamesmyatt
Copy link

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.

@jamesmyatt jamesmyatt changed the title tests module is included in distribution BUG: tests module is included in distribution Feb 22, 2021
@casperdcl
Copy link
Collaborator

Ah yes should be excluded indeed.

@casperdcl casperdcl self-assigned this Feb 22, 2021
@casperdcl casperdcl added the p0-critical Max priority (ASAP) label Feb 22, 2021
casperdcl added a commit that referenced this issue Feb 22, 2021
@casperdcl casperdcl added the testing Unit tests & debugging label Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p0-critical Max priority (ASAP) testing Unit tests & debugging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants