Closed MetRonnie closed 3 months ago
Hi @MetRonnie thank you very much for reporting this.
Please consider it an error on the previous versions that this used to work, and that v70 fixed by providing better validation and a more complete error message.
For attr
you need to provide a module name and an attribute, for example mymodule.__version__
.
It still works without the dot, if the current directory is the one containing pyproject.toml
and __init__.py
. E.g.
version = {attr = "__version__"}
Hi @MetRonnie thank you very much for reporting this.
Regarding {attr = "__version__"}
, by reading the code, it seems to be intentional that module name falls back to __init__
. Not sure if we should add an extra check there to make it also fail... (Sounds like a very edge case, there are other more important problems that with a "root" __init__.py
).
Any way unless you have a good customisation of package-dir
, I don't think that nesting pyproject.toml
inside of a package directory with __init__.py
makes much sense... Otherwise you will end up with an __init__.py
file on the root of your site-packages
directory and I am sure that it can cause some problems.
Ok, this is only affecting a test repository so no worries if there are good reasons to not support this
setuptools version
70.0.0
Python version
3.12
OS
Windows, Ubuntu
Additional environment information
No response
Description
The dot in
attr
now causes an errorExpected behavior
TIL the dot is not necessary, but this used to work in previous versions.
How to Reproduce
Write these in a directory:
Run in that directory:
Output