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

tox throws setuptools error #249

Closed
mleveck opened this issue May 31, 2022 · 1 comment
Closed

tox throws setuptools error #249

mleveck opened this issue May 31, 2022 · 1 comment

Comments

@mleveck
Copy link

mleveck commented May 31, 2022

I can run the tests via pytest just fine. But attempting tox -3 py38 as the README.md suggests results in the error below. I'm happy to debug on my own and even make a PR if this is a general issue.

But before I go further, does this happen on others' machines, or just mine? (error message suggests it's shouldn't be setup dependent as it's complaining about the directory layout. But I just want to make sure the error message isn't leading me astray)

(env) Matthews-MacBook-Pro:pyrsistent mleveck$ tox -e py38
GLOB sdist-make: /Users/mleveck/src/pyrsistent/setup.py
py38 inst-nodeps: /Users/mleveck/src/pyrsistent/.tox/.tmp/package/1/pyrsistent-0.18.1.zip
py38 installed: pyrsistent @ file:///Users/mleveck/src/pyrsistent/.tox/.tmp/package/1/pyrsistent-0.18.1.zip
py38 run-test-pre: PYTHONHASHSEED='1316811237'
py38 run-test: commands[0] | python /Users/mleveck/src/pyrsistent/setup.py test
/Users/mleveck/src/pyrsistent/.tox/py38/lib/python3.8/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
  warnings.warn(
running pytest
No parent package detected, impossible to derive `name`
error: Multiple top-level packages discovered in a flat-layout: ['pyrsistent', 'performance_suites'].

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.
ERROR: InvocationError for command /Users/mleveck/src/pyrsistent/.tox/py38/bin/python setup.py test (exited with code 1)
__________________________________________________________________________________ summary ___________________________________________________________________________________
ERROR:   py38: commands failed
@tobgu tobgu closed this as completed in c78961e Jun 1, 2022
@tobgu
Copy link
Owner

tobgu commented Jun 1, 2022

Thanks for reporting this!

It seems to be a general problem with many packages after a recent update in setuptools, see pypa/setuptools#3197. I believe it somehow falls back to autodetecting the package ignoring the packages directive in setup.py because there is also a pyproject.toml. I made a quick fix now by renaming the conflicting directory to a (better) name that is ignored by the autodetection.

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

No branches or pull requests

2 participants