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

Prevent setup.py from installing a "tests" package #458

Merged
merged 1 commit into from Dec 20, 2016

Conversation

Projects
None yet
3 participants
@Ichimonji10
Copy link
Contributor

commented Dec 19, 2016

The setup.py script uses function setuptools.find_packages to choose
which modules should be installed and which should not. By default, this
function incorrectly includes the top-level "tests" directory. Prevent
this by explicitly whitelisting the modules and packages to be included.

An even better solution is to place unit tests in a top-level "test"
directory. This is a common convention that allows unit tests to be run
on installed packages. However, the exact requirements and conventions
for doing this are unclear.

@Ichimonji10 Ichimonji10 changed the title Prevent setup.py from installing a "tests" package [DO NOT MERGE] Prevent setup.py from installing a "tests" package Dec 19, 2016

Prevent setup.py from installing a "tests" package
The `setup.py` script uses function `setuptools.find_packages` to choose
which modules should be installed and which should not. By default, this
function incorrectly includes the top-level "tests" directory. Prevent
this by explicitly whitelisting the modules and packages to be included.

An even better solution is to place unit tests in a top-level "test"
directory. This is a common convention that allows unit tests to be run
on installed packages. However, the exact requirements and conventions
for doing this are unclear.
@coveralls

This comment has been minimized.

Copy link

commented Dec 19, 2016

Coverage Status

Coverage remained the same at 66.373% when pulling c506499 on Ichimonji10:setup into 9d23684 on PulpQE:master.

@Ichimonji10 Ichimonji10 force-pushed the Ichimonji10:setup branch from c506499 to 70214dd Dec 19, 2016

@Ichimonji10

This comment has been minimized.

Copy link
Contributor Author

commented Dec 19, 2016

Tested with a clean venv, as follows:

cd ~/tmp/
python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install ~/code/pulp-smash
python -m unittest pulp_smash.tests.platform.api_v2.test_login

@Ichimonji10 Ichimonji10 changed the title [DO NOT MERGE] Prevent setup.py from installing a "tests" package Prevent setup.py from installing a "tests" package Dec 19, 2016

@coveralls

This comment has been minimized.

Copy link

commented Dec 19, 2016

Coverage Status

Coverage remained the same at 66.373% when pulling 70214dd on Ichimonji10:setup into 9d23684 on PulpQE:master.

@Ichimonji10 Ichimonji10 merged commit 70214dd into PulpQE:master Dec 20, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 66.373%
Details

@Ichimonji10 Ichimonji10 deleted the Ichimonji10:setup branch Dec 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.