Closed andy-maier closed 2 months ago
You probably are looking for tool.setuptools.packages
or tool.setuptools.py-modules
. Ref: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#setuptools-specific-configuration (or https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#custom-discovery if you have a nested tree of packages and don't want to specify one by one).
Yes, that's what I was looking for. Thanks much! My question 1 is addressed with that.
On question 2: Any chance something can be done about the tracebacks?
The error occurs in a subprocess and arrives as a subprocess.CalledProcessError
(with its output already having been emitted), which is next to useless. Unfortunately, this is intrinsic to how build hooks are invoked. A configuration error class would have to be standardised and configuration errors captured by the hook caller before build would be able to hide the stack trace.
If you feel like this is something worth pursuing, you can start a discussion at https://discuss.python.org/c/packaging/14. I'll close this now.
I have a project with two Python packages. It uses the flat layout and has a pyproject.toml file (see below) that uses setuptools as the backend, and its
setup.py
file has just a call tosetuptools.setup()
without any arguments.When I invoke "build", it fails because it cannot identify the Python packages:
When I try to follow the option 3, it fails as well, saying that
packages
is not allowed (the same happens withpy_modules
):The pyproject.toml file with
packages
specified looks like this:This happened with: macOS Python 3.12 build 1.2.1 setuptools 69.5.1 wheel 0.43.0
My questions are: