Re: testseq update (6/13/17)
Peter Cock <[email protected]> Tue, 13 Jun 2017 11:17:38 +0100
| Newsgroups | gmane.comp.python.bio.devel |
|---|---|
| Message-ID | <CAKVJ-_5_dd6WXiAv8QDy_j676-E2Ein20TER1aq4T8B6xyX86Q@mail.gmail.com> |
I commented on GitHub: https://github.com/biopython/biopython/pull/1269#issuecomment-308071782 I wonder if the complicated import tricks you are trying in order to be able to do "from Scripts import testseq" or similar could be avoided by including Scripts/ in sys.path in the same way that run_tests.py ensures our complied C modules can be imported from the build/ subdirectory? Peter On Tue, Jun 13, 2017 at 8:30 AM, Adil Iqbal <[email protected]> wrote: > TL:DR - Importing issue solved by 'manually_import' function. It can be used > to solve similar problems in the future. Decided to remove non-Bio doctest > for problematic versions of python. Open to input/suggestions/criticisms. > Thank you. > > Hello all, > > I have solved the 'testseq' importing issue. > > Since I could not import 'testseq' directly, I wrote a function that could > manually import 'testseq' into the 'test_testseq' unit test using the > built-in module 'importlib'. The function, named 'manually_import,' is > generalized to work for any future unit tests for modules outside the 'Bio' > package. You can see the code in isolation here: > https://github.com/Adil-Iqbal/Personal-Projects/blob/master/Test%20Sequence/manually_import.py > > If ever such an issue should arise again, please direct the contributor to > "Tests/test_testseq.py" > They can import the 'manually_import' function directly from there. > > Than the issue arose that the 'run_tests.py' file could not import > 'Scripts.testseq' prior to python 3.3. I decided to try using a permutation > of the 'manually_import' code to solve the problem and it worked! With one > caveat, the doctests within 'testseq.py' were subject to the same import > restrictions and copying the 'manually_import' code again within the > doctests seemed excessive. The solution that worked in the end was to remove > doctests from outside of the 'Bio' package in python versions prior to 3.3. > > Some of you have noted that I am very 'commited' to finishing my work on > this project. I've downloaded and am now running flake8 tests locally. I'm > looking into integrating flake8 directly into my IDE. I've also downloaded > virtualenv, and am looking into other solutions for local testing as well > (though it's not currently set up). The problem will definitely be addressed > before I begin work on reverting the seeding. Thank you for helping. It > means a lot. > > Best, > Adil > > _______________________________________________ > Biopython-dev mailing list > [email protected] > http://mailman.open-bio.org/mailman/listinfo/biopython-dev