Repository navigation
Description
This is a spin out from #2008, where we have agreed to adopt the black code formatting tool for Biopython:
https://github.com/psf/black
That issue focused on applying black to the main code base (Bio/, BioSQL/, and also Scripts/ and Doc/examples/).
This issue is for applying black to the Biopython test suite.
In principle this is a good issue for new contributors. However, many of the tests include expected data values, so compared to the Biopython main code there are more likely to be cases where black does a bad job - which will need some discussion (e.g. can it be improved with extra brackets, or do we turn off black for a portion of a test file?).
You will need to install black, flake8, and associated plugins as described in https://github.com/biopython/biopython/blob/master/CONTRIBUTING.rst - and we recommend turning on the git pre-commit hook).
Example workflow:
git checkout master # and make sure it is up to date
git checkout -b black_test_XXX # start a new branch
black Tests/test_XXX.py # do the conversion
flake8 Tests/test_XXX.py # check for string concatenation etc
emacs Tests/test_XXX.py # review and make any fixes
git commit Tests/test_XXX.py -m "Apply black to Tests/test_XXX.py"
git push my_fork black_text_XXX # push the branch to your personal GitHub
To avoid duplication of effort, please comment here if you are going to work on a particular file, or group of files.
Activity
svalqui commentedon Jan 20, 2020
I'll work on test_PDB*
svalqui commentedon Jan 22, 2020
I'll work on test_SeqIO*
svalqui commentedon Feb 5, 2020
I'll work on test_SearchIO* files.
svalqui commentedon Feb 9, 2020
I'll work on test_pro* files.
svalqui commentedon Feb 11, 2020
I'll work on test_Phylo* files.
svalqui commentedon Feb 12, 2020
I'll work on test_PAML* files.
svalqui commentedon Feb 13, 2020
I'll work on test_T* files.
svalqui commentedon Feb 16, 2020
I'll skip test_Tutorial.py as is raising errors with some doctest on the tutorial.
ValueError: 4 Tutorial doctests failed:
test_chapter_entrez_line_00202,
test_chapter_entrez_line_00325,
test_chapter_entrez_line_00419,
test_chapter_entrez_line_00466,
svalqui commentedon Feb 17, 2020
I'll work on SCOP files
peterjc commentedon Feb 17, 2020
You can try
python run_tests.py test_Tutoturial.py --offlinebut it sounds like four of the online Entrez tests in the Tutorial were failing. Please confirm if that was only after running black or not. If not, please open a new issue. Thanks.svalqui commentedon Feb 17, 2020
It was before running black, I have logged an issue for that.
svalqui commentedon Feb 17, 2020
I'll work on test_PopGen* files
40 remaining items
jvfe commentedon Jul 22, 2020
I'll work on
test_Emboss.pyandtest_Clustalw_tool.py, fixing what was mentioned in #2835 as well.mariecrane commentedon Jul 22, 2020
I can work on Tests/test_KEGG.py
jvfe commentedon Jul 22, 2020
I'll work on
test_HMM*jvfe commentedon Jul 23, 2020
I'll work with the remaining
test_*_tool.pyjvfe commentedon Jul 23, 2020
I'll work on the remaining
test_C*.pyjvfe commentedon Jul 23, 2020
I'll work on
test_pairwise*.pyandtest_AlignI*.pyjvfe commentedon Jul 24, 2020
I'll work on
test_P*.pyjvfe commentedon Jul 24, 2020
I'll work on
test_align*.pyjvfe commentedon Jul 25, 2020
I'll work on
test_Seq*.pyandtest_N*.pyjvfe commentedon Jul 25, 2020
I'll work on the remaining tests, some also require changing assert statements, as specified in #2835, most should be minor changes and easy to merge.
peterjc commentedon Jul 25, 2020
@jvfe the final pull request to close this will be to update the flake8 configuration to stop ignoring black: https://github.com/biopython/biopython/blob/master/.flake8 setting
per-file-ignores =And make a slight edit to https://github.com/biopython/biopython/blob/master/CONTRIBUTING.rst
And it would deserve mention in https://github.com/biopython/biopython/blob/master/NEWS.rst
peterjc commentedon Jul 25, 2020
Almost there...
jvfe commentedon Jul 25, 2020
Oh, must've missed those cause I checked test_*. I'll do another PR for them.
peterjc commentedon Jul 25, 2020
And we're done - a real team effort, thank you to everyone including all the BCC2020 CoFest participants who helped with the final push.