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

Exclude the 'tests' directory from find_packages in setup.py #252

Merged
merged 1 commit into from
Jul 11, 2019

Conversation

jeancochrane
Copy link
Contributor

@jeancochrane jeancochrane commented Jul 11, 2019

Overview

Previously, find_packages() didn't exclude the tests dir, which would cause pip to install the package under the the name tests when installing this . (We introduced this change in v1.0 when we switched from specifying councilmatic_core as the package to find_packages()).

Exclude the tests dir from packaging to prevent ImportErrors when trying to run tests in dependent packages.

Testing instructions

Test this change by testing datamade/django-councilmatic-notifications#33:

  • cd to django-councilmatic-notifications
  • Install your local version of django-councilmatic-notifications (with test dependencies) with pip install -e .[tests]
  • Install this version of django-councilmatic, either by running:
pip install /path/to/local/django-councilmatic

or

pip install git+https://github.com/datamade/django-councilmatic@feature/jfc/remove-tests-from-find-packages
  • Run pytest and confirm tests run normally

Copy link
Member

@hancush hancush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a+ spelunking, a+ fix! thanks, @jeancochrane :-)

@jeancochrane jeancochrane merged commit 9055dc5 into 1.0 Jul 11, 2019
@jeancochrane jeancochrane deleted the feature/jfc/remove-tests-from-find-packages branch July 11, 2019 21:59
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 this pull request may close these issues.

2 participants