Build error on Arch Linux with python-build
On Arch Linux with these make dependencies installed: python-build python-installer python-setuptools python-wheel
and running python -m build --wheel --no-isolation
(as per https://wiki.archlinux.org/title/Python_package_guidelines#Standards_based_(PEP_517)) leads to the following:
* Getting build dependencies for wheel...
validate_pyproject.api.load_builtin_plugin defines `tool.distutils` schema
validate_pyproject.api.load_builtin_plugin defines `tool.setuptools` schema
No `packages` or `py_modules` configuration, performing automatic discovery.
`flat-layout` detected -- analysing .
discovered packages -- ['mrhlpr', 'mrtest', 'mrhlpr.data']
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
main()
File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/usr/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 1, in <module>
File "/usr/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 159, in setup
dist.parse_config_files()
File "/usr/lib/python3.12/site-packages/setuptools/dist.py", line 627, in parse_config_files
pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
File "/usr/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py", line 72, in apply_configuration
config = read_configuration(filepath, True, ignore_option_errors, dist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py", line 137, in read_configuration
return expand_configuration(asdict, root_dir, ignore_option_errors, dist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py", line 162, in expand_configuration
return _ConfigExpander(config, root_dir, ignore_option_errors, dist).expand()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py", line 210, in expand
self._expand_all_dynamic(dist, package_dir)
File "/usr/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py", line 255, in _expand_all_dynamic
version=self._obtain_version(dist, package_dir),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py", line 304, in _obtain_version
return _expand.version(self._obtain(dist, "version", package_dir))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py", line 293, in _obtain
return self._expand_directive(
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py", line 287, in _expand_directive
return _expand.read_attr(directive["attr"], package_dir, root_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/expand.py", line 188, in read_attr
_parent_path, path, module_name = _find_module(module_name, package_dir, root_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/expand.py", line 229, in _find_module
if package_dir:
^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/expand.py", line 459, in __len__
return len(self._target())
^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/expand.py", line 452, in _target
self._value = self._obtain()
^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/config/expand.py", line 422, in _get_package_dir
self()
File "/usr/lib/python3.12/site-packages/setuptools/config/expand.py", line 412, in __call__
self._dist.set_defaults(name=False) # Skip name, we can still be parsing
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/discovery.py", line 353, in __call__
self._analyse_package_layout(ignore_ext_modules)
File "/usr/lib/python3.12/site-packages/setuptools/discovery.py", line 387, in _analyse_package_layout
or self._analyse_flat_layout()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/discovery.py", line 444, in _analyse_flat_layout
return self._analyse_flat_packages() or self._analyse_flat_modules()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/setuptools/discovery.py", line 450, in _analyse_flat_packages
self._ensure_no_accidental_inclusion(top_level, "packages")
File "/usr/lib/python3.12/site-packages/setuptools/discovery.py", line 480, in _ensure_no_accidental_inclusion
raise PackageDiscoveryError(cleandoc(msg))
setuptools.errors.PackageDiscoveryError: Multiple top-level packages discovered in a flat-layout: ['mrhlpr', 'mrtest'].
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_wheel
Perhaps the gpep517 that is used for Alpine packaging works a bit differently?