Skip to content
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

skip test for QCPSuperimposer if the C module is not compiled #1061

Merged
merged 1 commit into from
Feb 14, 2017
Merged

skip test for QCPSuperimposer if the C module is not compiled #1061

merged 1 commit into from
Feb 14, 2017

Conversation

BioGeek
Copy link
Contributor

@BioGeek BioGeek commented Feb 14, 2017

The QCPSuperimposer test fails with an ImportError if the C module is not compiled

$ python3 run_tests.py test_QCPSuperimposer
Python version: 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609]
Operating system: posix linux
test_QCPSuperimposer ... loading tests failed:
Failed to import test module: test_QCPSuperimposer
Traceback (most recent call last):
  File "/usr/lib/python3.5/unittest/loader.py", line 153, in loadTestsFromName
    module = __import__(module_name)
  File "/home/jeroen/OpenSource/biopython/Tests/test_QCPSuperimposer.py", line 15, in <module>
    from Bio.PDB.QCPSuperimposer import QCPSuperimposer
  File "/home/jeroen/OpenSource/biopython/Bio/PDB/QCPSuperimposer/__init__.py", line 15, in <module>
    from .qcprotmodule import FastCalcRMSDAndRotation
ImportError: No module named 'Bio.PDB.QCPSuperimposer.qcprotmodule'

----------------------------------------------------------------------
Ran 1 test in 0.059 seconds

FAILED (failures = 1)

This patch adds an MissingExternalDependencyError so that the test is skipped if the C module is not compiled.

@BioGeek
Copy link
Contributor Author

BioGeek commented Feb 14, 2017

The failed Travis CI tests seem unrelated.

For, TOXENV=pypy-nocov, the Bio.QCPSuperimposer test is skipped because NumPy is not available

test_QCPSuperimposer ... skipping. Install NumPy if you want to use Bio.QCPSuperimposer.

but fails later on test_Nexus.OldSelfTests.

For TOXENV=pypy3-nocov, the build fails because the build machine runs Python 3.2.5 but Python 3.3 or later is required.

@peterjc
Copy link
Member

peterjc commented Feb 14, 2017

The TravisCI failure is #1059 which could be fixed with a newer version of PyPy...

@peterjc
Copy link
Member

peterjc commented Feb 14, 2017

PyPy3 is currently failing thus 9a0e2ee - something is wrong in the dependency chain to install and run tox.

@peterjc
Copy link
Member

peterjc commented Feb 14, 2017

As to the aim of this pull request, we currently expect the user to have compiled Biopython's C code BEFORE running the tests, e.g.

python setup.py build
python setup.py text
(sudo) python setup.py install

What is your use-case for making the test skip (rather than the current very visible failure)?

@BioGeek
Copy link
Contributor Author

BioGeek commented Feb 14, 2017

My aim was just for consistency with the other tests: test_KDTree.py , test_PDB_KDTree.py and test_trie.py all give similar errors when their respective C modules are not compiled.

@peterjc
Copy link
Member

peterjc commented Feb 14, 2017

So they do, good point.

Are you happy to dual licence your contributions under both the Biopython License Agreement AND the BSD 3-Clause License? See #898.

Also, are you happy to be thanked by name in the NEWS and CONTRIB files?

@BioGeek
Copy link
Contributor Author

BioGeek commented Feb 14, 2017

I have already given my permission to dual license my contributions and I'm happy to be thanked by name in the NEWS and CONTIB files.

And thank you for all the work you do for this great piece of bioinformatics software!

@peterjc peterjc merged commit b667fbc into biopython:master Feb 14, 2017
@codecov-io
Copy link

Codecov Report

Merging #1061 into master will decrease coverage by -0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1061      +/-   ##
==========================================
- Coverage   80.77%   80.77%   -0.01%     
==========================================
  Files         322      322              
  Lines       49404    49404              
==========================================
- Hits        39907    39906       -1     
- Misses       9497     9498       +1
Impacted Files Coverage Δ
Bio/Restriction/Restriction.py 52.22% <ø> (-0.12%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06b6cd6...2875310. Read the comment docs.

@peterjc
Copy link
Member

peterjc commented Feb 14, 2017

Thank you - acknowledgment in e76b29f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants