-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Single-sourcing version, setup.cfg, attr, and imports #1960
Comments
I just noticed, that description = attr: the_package.__doc__ doesn't currently work and was kind of disappointed. Would you be willing to accept a PR that enables |
Hi @RuRo ! I think you should open a new issue to discuss this, if you want you can still refer to this one in the description. |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to #1724
Currently
setup.cfg
provide anattr:
directive to extract a value from a file, which is really nice typically to single-source version and description like:But the
version = attr: the_package.__version__
will fail ifthe_package
imports install dependencies (that are typically not installed yet), which is in fact really common.Maybe we could use the ast module in the current
attr
implementation, and fallback on importing if it does not work, for backard compatibility? (for the cases where the attribute is imported or computed).Tried a basic POC:
It would not work for
__doc__
though, but we could also add a new directive, saydoc:
which would use theast.get_docstring
function, this is another issue.The text was updated successfully, but these errors were encountered: