Release new version pytest-asyncio with the fix of setuptools-scm issue
Closed this issue · 6 comments
With https://github.com/pytest-dev/pytest-asyncio/releases/tag/v1.1.0
pytest-asyncio fails to build when setuptools uses automatic package discovery due to the presence of both dependencies/ and pytest_asyncio/ directories at the project root level.
$ python -m build --sdist --wheel
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- setuptools-scm==9.2
- setuptools==80.9
* Getting build dependencies for sdist...
error: Multiple top-level packages discovered in a flat-layout: ['dependencies', 'pytest_asyncio'].
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 Backend subprocess exited when trying to invoke get_requires_for_build_sdist
I saw this because I was trying build the v1.1.0 release with https://github.com/python-wheel-build/fromager
This is the fix a422929 to the issue.
FYI you shouldn't use --sdist --wheel.
Also, the error log does not seem to have anything to do with setuptools-scm.
@LalatenduMohanty Thanks for the report.
The issue is indeed caused by an interaction between setuptools-scm and pytest-asyncio. Pytest-asyncio didn't fully transition from setup.cfg configuration of setuptools to configuration in pyproject.toml. The underlying upstream issue suggests that the approach taken by pytest-asyncio was never supported in the first place.
The configuration has been addressed as part of #1192. However, pypa/setuptools-scm#1216 suggests this will also be addressed by upstream.
In any case, agree that it makes sense to create a new patch release for pytest-asyncio.
@LalatenduMohanty pytest-asyncio v1.1.1 is now released and specifically contains the setuptools-scm compatibility fix.
The v1.2.0 release will follow in a couple of minutes.