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 tests package from built package #507

Closed
aldenrogers opened this issue May 2, 2022 · 0 comments · Fixed by #508
Closed

Exclude tests package from built package #507

aldenrogers opened this issue May 2, 2022 · 0 comments · Fixed by #508
Labels
bug Something isn't working

Comments

@aldenrogers
Copy link
Contributor

Describe the bug
Currently setup.py will find and package everything, including the tests package. This is bad because it clutters the top-level namespace and can cause name conflicts if multiple packages include an identical name.

To Reproduce
To see this, build a wheel with

$ python -m pip install build
$ python -m build --wheel

Then list the contents of the wheel with your favorite zip program, e.g.

$ 7z l dist/causalml-0.12.3-cp310-cp310-linux_x86_64.whl
... (more files)
2022-04-25 19:18:56 .....         4210         1059  causalml/optimize/utils.py
2022-04-25 19:18:56 .....         4079         1255  causalml/optimize/value_optimization.py
2022-04-25 19:18:56 .....            0            2  tests/__init__.py
2022-04-25 19:18:56 .....         1432          365  tests/conftest.py
2022-04-25 19:18:56 .....          292          189  tests/const.py
2022-04-25 19:18:56 .....         1412          592  tests/test_cevae.py
... (etc.)

Expected behavior
Built wheel only contains dist-info files and causalml package.

Environment (please complete the following information):

  • OS: Arch linux
  • Python Version: 3.10
  • Versions of Major Dependencies (pandas, scikit-learn, cython): pandas==1.4.2, scikit-learn==1.0.2, cython==0.29.28

Additional context
I'll submit a PR with a fix momentarily.

@aldenrogers aldenrogers added the bug Something isn't working label May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant