-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Modify ImportError traceback for _aligners #1736
Modify ImportError traceback for _aligners #1736
Conversation
Bio/Align/__init__.py
Outdated
try: | ||
from Bio.Align import _aligners | ||
except ImportError as e: | ||
new_exc = ImportError("""{}: you should not import directly from the |
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.
Don't use a triple quote string, which inserts the new lines breaks as is. Use single quotes (which will auto-concatenate)
Codecov Report
@@ Coverage Diff @@
## master #1736 +/- ##
==========================================
- Coverage 85.57% 85.15% -0.42%
==========================================
Files 331 331
Lines 50086 50091 +5
==========================================
- Hits 42859 42657 -202
- Misses 7227 7434 +207
Continue to review full report at Codecov.
|
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.
Looks good to me in principle - over to @mdehoon
TravisCI failure linked to ReportLab, see #1737 1737 |
TravisCI failure caused by #1737 (latest ReportLab release). |
Looks good to me. As this error typically appears when a user runs "python setup.py install" and directly afterwards tries to import Bio, some day we should reorganize the directory structure such that Bio/ etc. is not a direct subdirectory of biopython, then this error is unlikely to happen at all. |
This pull request relates to an issue raised on the mailing list here. I also saw the same question asked on Stack overflow here, and I then later independently encountered the issue myself because I had used some soft links rather than doing a proper install. The error can occur on a few imports, for example:
I found the error slightly cryptic until I read through the mailing list thread, and perhaps I am not alone. Michiel noted in the mailing list thread here that
numpy
have a more informative traceback, I suggest modifying the traceback in this case in a similar way:Thoughts?
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rst
file and understand that AppVeyor andTravisCI will be used to confirm the Biopython unit tests and
flake8
stylechecks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rst
andCONTRIB.rst
as part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)