-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace setup.py with declarative setup.cfg #292
Conversation
setup.cfg
Outdated
@@ -1,3 +1,43 @@ | |||
[metadata] | |||
name = distro | |||
version = 1.5.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on closing #265 by using version = attr: distro.__version__
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.