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

6.12.0 package includes tests #1778

Closed
Tecuya opened this issue Dec 15, 2022 · 5 comments · Fixed by #1782
Closed

6.12.0 package includes tests #1778

Tecuya opened this issue Dec 15, 2022 · 5 comments · Fixed by #1782
Labels
bug Something is not working pyproject.toml Related to pyproject.toml support

Comments

@Tecuya
Copy link

Tecuya commented Dec 15, 2022

The 6.12.0 release is installing a tests package containing the tests for pip-tools.

This means any project that has pip-tools installed will have its own tests modules eclipsed by pip-tools' tests. This broke our CI build when I upgraded all the deps in a project today, chased it down to pip-tools.

Demonstration:

root@docker-fi:~# pip install pip-tools==6.11.0
[...snip...]
Successfully installed pip-tools-6.11.0
root@docker-fi:~# ls /usr/local/lib/venv/lib/python3.9/site-packages/tests
ls: cannot access '/usr/local/lib/venv/lib/python3.9/site-packages/tests': No such file or directory
root@docker-fi:~# pip install pip-tools==6.12.0
[...snip...]
Successfully installed pip-tools-6.12.0
root@docker-fi:~# ls /usr/local/lib/venv/lib/python3.9/site-packages/tests
__init__.py  conftest.py   test_cache.py	test_cli_sync.py  test_fake_index.py  test_minimal_upgrade.py	test_repository_pypi.py  test_subprocess_utils.py  test_top_level_editable.py  test_writer.py
__pycache__  constants.py  test_cli_compile.py	test_data	  test_logging.py     test_repository_local.py	test_resolver.py	 test_sync.py		   test_utils.py	       utils.py
root@docker-fi:~# 
@webknjaz
Copy link
Member

Just to clarify the expectations:

  1. the sdist must bundle tests
  2. the wheel should avoid including them

P.S. I haven't checked but it might be related to the updates in setuptools. Whoever ends up debugging this could try to verify this by running PIP_CONSTRAINT=build-constraints.txt python -m build with various setuptools versions pinned in build-constraints.txt and using wheel unpack to inspect the contents.
Checking the build log output can also shed some light on the problem.

@tnlogy
Copy link

tnlogy commented Dec 16, 2022

I also have some issues with this, now I cannot import my local package from tests.utils import ... since pip-tools tests directory have a utils.py file in it.

@AndydeCleyre
Copy link
Contributor

The current wheel is also polluting site-packages with docs and examples.

@atugushev atugushev added bug Something is not working pyproject.toml Related to pyproject.toml support labels Dec 16, 2022
@q0w
Copy link
Contributor

q0w commented Dec 16, 2022

But the default autodiscovery provided by setuptools does not work for pip-tools (neither src layout nor flat layout), so maybe provide explicity packages for setuptools.packages.find or exclude explicitly tests and other packages

@atugushev
Copy link
Member

The fix is released as part of pip-tools v6.12.1.

@atugushev atugushev unpinned this issue Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working pyproject.toml Related to pyproject.toml support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants