Skip to content

BUG: tests module is included in distribution #629

@jamesmyatt

Description

@jamesmyatt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions