-
Notifications
You must be signed in to change notification settings - Fork 660
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
Issue #784 -- Dynamic author list #787
Issue #784 -- Dynamic author list #787
Conversation
A list of authors usable from python is generated from the AUTHORS file by 'package/setup.py'. That list allows to maintain a single list of authors instead of one list in AUTHORS and one list in the sphinx documentation. MDAnalysis.__init__ imports authors.py to give access to MDAnalysis.__authors__.
The list of authors used by sphinx is the one in authors.py.
@@ -140,6 +140,7 @@ | |||
import warnings | |||
|
|||
from .version import __version__ | |||
from .authors import __authors__ |
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.
So if setup is ran from a location where you don't have write permission (is this possible?), this file won't be generated. So would it be safer to wrap this in a try/except block just so this never stops the entire module working one day?
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.
Good call. Fixed.
MDAnalysis should not fail if authors.py cannot be generated and therefore imported. If authors.py is not present, then __authors__ is an empty list.
Issue #784 -- Dynamic author list
We prohibit relative imports in the tests (see MDAnalysis#189). When adding tests for the dynamic author list (MDAnalysis#787), I introduced some such relative imports.
Remove relative imports introduced in #787
@jbarnoud , this commit seems to badly break the 3.3 tests right at the beginning, see e.g. https://travis-ci.org/MDAnalysis/mdanalysis/jobs/117197996
|
Ghraaa! I omitted to run the tests on python 3. I'll work on this. If anybody has an idea why Travis crashes on the python 3 builds, it would be nice to fix. I had a look but I do not know what happens. |
The dynamic author list introduced in MDAnalysis#787 did not work on python 3 because of the way encoding was handled. This commit fixes the handling of file encodings by using the codecs library.
Fixes #784
Changes made in this Pull Request:
setup.py
reads AUTHORS and writeauthors.py
that get imported by__init__.py
to expose__authors__
.__authors__
for its author list.The order of the authors is not perfect. Except for the two first authors and the last author, the authors are sorted alphabetically by their last name. Yet, last names are difficult to define; the last word of the name is used as last name. It causes an issue with "Christian Beckstein (logo)" because of the "(logo)", also "Manel Nuno Melo" was sorted at "Nuno" and is now sorted as "Melo".
The code is repeated between
package/setup.py
andtestsuite/setup.py
. I do not like it much but I do not see how to avoid that easily.PR Checklist
Docs?