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

Closed
jamesmyatt opened this issue Mar 9, 2021 · 5 comments
Closed

BUG: tests module is included in distribution #629

jamesmyatt opened this issue Mar 9, 2021 · 5 comments

Comments

@jamesmyatt
Copy link

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, pytorch/noarch::captum-0.3.1-0
  path: 'lib/python3.8/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.

@vivekmig vivekmig linked a pull request Mar 16, 2021 that will close this issue
@vivekmig
Copy link
Contributor

Thanks for catching this issue @jamesmyatt and the great suggestions! You are right, we were unintentionally distributing this tests module. For now, we have tested a fix to exclude the tests module, which should resolve the issue for future releases.

@jamesmyatt
Copy link
Author

@vivekmig , is there any chance of a 0.3.2 release with this fix?

@vivekmig
Copy link
Contributor

Hi @jamesmyatt , we are planning to do the 0.4.0 release in the next few weeks, so this fix will be included there.

@jamesmyatt
Copy link
Author

Thanks

@NarineK
Copy link
Contributor

NarineK commented Jul 9, 2021

Closing this, since 0.4 release it out.

@NarineK NarineK closed this as completed Jul 9, 2021
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

Successfully merging a pull request may close this issue.

3 participants