8000 setuptools >= 61 package discovery issue with python setup.py clean · Issue #23423 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

setuptools >= 61 package discovery issue with python setup.py clean #23423

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

Closed
lesteve opened this issue May 19, 2022 Discussed in #23413 · 1 comment · Fixed by #23426
Closed

setuptools >= 61 package discovery issue with python setup.py clean #23423

lesteve opened this issue May 19, 2022 Discussed in #23413 · 1 comment · Fixed by #23426

Comments

@lesteve
Copy link
Member
lesteve commented May 19, 2022

Originally reported in #23413

This seems to be a change in setuptools 61 about package discovery ... probably a related issue is pypa/setuptools#3197

mamba create -n test -c conda-forge python=3.9 numpy scipy cython -y
conda activate test
python setup.py clean
error: Multiple top-level packages discovered in a flat-layout: ['prof', 'sklearn', 'maint_tools', 'build_tools', 'asv_benchmarks', 'cache_directory'].

To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.

If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:

1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names

To find more information, look for "package discovery" on setuptools docs.

Weirdly enough the other setup.py commands seems to work OK e.g. python setup.py develop or python setup.py install ...

@lesteve lesteve added the Bug label May 19, 2022
@lesteve
Copy link
Member Author
lesteve commented May 19, 2022

Maybe we should follow numpy and not support python setup.py clean: https://github.com/numpy/numpy/blob/ad1096884e82a8176e7b5125d168ceeca77c3bf7/setup.py#L367-L373. They have done this 7 years ago apparently.

We can change make clean to do git clean -Xdf (remove only ignored files so amongst other things compiled files and leave unversioned files alone) as suggested by the numpy error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0