When an option is changed on a command object, calling ensure_finalized
for a second time will not run finalize_options again, because
ensure_finalized is a no-op the second time. By resetting the finalized
attribute, we can be sure that whatever computation takes place in
finalize_options will happen again.
(In test_command_clean, I removed two lines that were a no-op.)
- minor cleanup in Metadata
- trigger creation of the sysconfig._CONFIG_VARS dict
- home_page is used over home-page: it’s not a compound word, it’s an
escaped space
Distutils2 is now synchronized with Packaging.
These options were used to implement “setup.py --name”,
“setup.py --version”, etc. which are now handled by the pysetup metadata
action or direct parsing of the setup.cfg file.
As a side effect, the Distribution class no longer accepts a 'url' key
in its *attrs* argument: it has to be 'home-page' to be recognized as a
valid metadata field and passed down to the dist.metadata object.
I cleaned up some comments, docstrings and code along the way.