Skip to content

remove tests from package distribution#1779

Merged
thealligatorking merged 1 commit intoopentensor:stagingfrom
backend-developers-ltd:remove_tests_from_dist
Apr 10, 2024
Merged

remove tests from package distribution#1779
thealligatorking merged 1 commit intoopentensor:stagingfrom
backend-developers-ltd:remove_tests_from_dist

Conversation

@mjurbanski-reef
Copy link
Contributor

Bug

After pip install bittensor site-packages include:

.venv/lib/python3.11/site-packages/bittensor/*
.venv/lib/python3.11/site-packages/tests/helpers/*
.venv/lib/python3.11/site-packages/tests/integration_tests/*
.venv/lib/python3.11/site-packages/tests/unit_tests/*

i.e. tests are packaged as top-level package and may very well conflict with other python libs that made the same mistake.

Description of the Change

  • exclude tests from setuptools autodiscovery

Alternate Designs

None.
Although at some point deprecated setup.py should be dropped in favor of pdm or more modern packaging tooling, the same error could be done with it as well.

Possible Drawbacks

None I know of.
If someone wants tests, then they need test dependencies as well.

Verification Process

# cleaned previous builds; without this some stuff can still be included even after the fix
python setup.py clean --all
rm -rf build dist *.egg-info

python setup.py bdist_wheel
python setup.py sdist
# examined output if tests/ are still added to .whl and tar

# tested `pip install ./dist/*.whl` and same with sdist to check if installation still works and `btcli` launches

Release Notes

  • Removed accidentally included tests package from Python dist package (i.e. PyPI package)

@mjurbanski-reef mjurbanski-reef changed the title remove tests and pyc from package distribution remove tests from package distribution Apr 10, 2024
@thealligatorking thealligatorking merged commit 53175a5 into opentensor:staging Apr 10, 2024
@thealligatorking thealligatorking mentioned this pull request Apr 11, 2024
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