Closed peterjc closed 4 years ago
If you want to do a few related files together on a single pull request, that's fine too. e.g. Tests/test_SeqIO_*.py
I'll work on Tests/test_Uniprot.py
I'll work on test_Emboss.py
and test_Clustalw_tool.py
, fixing what was mentioned in #2835 as well.
I can work on Tests/test_KEGG.py
I'll work on test_HMM*
I'll work with the remaining test_*_tool.py
I'll work on the remaining test_C*.py
I'll work on test_pairwise*.py
and test_AlignI*.py
I'll work on test_P*.py
I'll work on test_align*.py
I'll work on test_Seq*.py
and test_N*.py
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.
@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
Almost there...
$ cd Tests/
$ black --check .
would reformat /Users/xxx/repositories/biopython/Tests/requires_wise.py
would reformat /Users/xxx/repositories/biopython/Tests/requires_internet.py
would reformat /Users/xxx/repositories/biopython/Tests/search_tests_common.py
would reformat /Users/xxx/repositories/biopython/Tests/PAML/gen_results.py
would reformat /Users/xxx/repositories/biopython/Tests/seq_tests_common.py
would reformat /Users/xxx/repositories/biopython/Tests/pairwise2_testCases.py
would reformat /Users/xxx/repositories/biopython/Tests/test_Seq_objs.py
Almost there...
$ cd Tests/ $ black --check . would reformat /Users/xxx/repositories/biopython/Tests/requires_wise.py would reformat /Users/xxx/repositories/biopython/Tests/requires_internet.py would reformat /Users/xxx/repositories/biopython/Tests/search_tests_common.py would reformat /Users/xxx/repositories/biopython/Tests/PAML/gen_results.py would reformat /Users/xxx/repositories/biopython/Tests/seq_tests_common.py would reformat /Users/xxx/repositories/biopython/Tests/pairwise2_testCases.py would reformat /Users/xxx/repositories/biopython/Tests/test_Seq_objs.py
Oh, must've missed those cause I checked test_*. I'll do another PR for them.
And we're done - a real team effort, thank you to everyone including all the BCC2020 CoFest participants who helped with the final push.
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 alsoScripts/
andDoc/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:
To avoid duplication of effort, please comment here if you are going to work on a particular file, or group of files.