Replace setup.py with declarative setup.cfg#292
Replace setup.py with declarative setup.cfg#292jdufresne merged 1 commit intopython-distro:masterfrom jdufresne:setup.cfg
Conversation
setup.cfg
Outdated
| @@ -1,3 +1,43 @@ | |||
| [metadata] | |||
| name = distro | |||
| version = 1.5.0 | |||
There was a problem hiding this comment.
Thoughts on closing #265 by using version = attr: distro.__version__?
There was a problem hiding this comment.
I addressed the issue in PR #294.
We can't use version = attr: distro.__version__ as that would break the Sphinx configuration which parses setup.cfg to grab the version. I've taken the alternative approach of querying the installed version from distro.py. This is safer as other tools can continue to rely on setup.cfg as a source of truth.
There was a problem hiding this comment.
@sethmlarson I've applied this suggestion in the latest revision.
@hartwork This also fixes your suggestion from earlier. The docs can now be built with Python 2 again.
More review feedback welcome.
Avoid mixing code with configuration. Running setuptools no longer runs arbitrary custom code, it is all driven through a key/value configuration file, setup.cfg. This also simplifies other tools interaction. For example, the Sphinx config no longer needs to parse source code (and hope the format hasn't changed). Now, it can use the configparser library to pull values from setup.cfg.
sethmlarson
left a comment
There was a problem hiding this comment.
LGTM, thanks for this.
Avoid mixing code with configuration.
Running setuptools no longer runs arbitrary custom code, it is all
driven through a key/value configuration file, setup.cfg.
This also simplifies other tools interaction. For example, the Sphinx
config no longer needs to parse source code (and hope the format hasn't
changed). Now, it can use the configparser library to pull values from
setup.cfg.