Skip to content

Commit

Permalink
PEP8 cleanup and update tox configuration to support python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezra Peisach committed Sep 10, 2024
1 parent 32bf3f2 commit ff74780
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
31 changes: 16 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ source_paths = wwpdb/apps/seqmodule wwpdb/apps/tests-seqmodule setup.py
#
test_path_1 = "wwpdb/apps/tests-seqmodule"
# These are placeholders valid source directories without tests files
test_path_2 = "wwpdb/apps/seqmodule/templates"
test_path_3 = "wwpdb/apps/seqmodule/templates"
test_path_4 = "wwpdb/apps/seqmodule/templates"
#test_path_2 = "wwpdb/apps/seqmodule/templates"
#test_path_3 = "wwpdb/apps/seqmodule/templates"
#test_path_4 = "wwpdb/apps/seqmodule/templates"
#
# Comma separate list of directories/patterns for which test coverage will be evaluated
coverage_source_paths = "wwpdb/apps/seqmodule,wwpdb/apps/tests-seqmodule"
Expand Down Expand Up @@ -50,13 +50,14 @@ allowlist_externals = echo
deps =
commands =
echo "Starting default tests in testenv"
basepython = py312: python3.12
basepython = py313: python3.13
py312: python3.12
py311: python3.11
py310: python3.10
py39: python3.9
py27: python2.7

[testenv:py3{9,10,11,12},py27]
[testenv:py3{9,10,11,12,13},py27]
description = 'Run unit tests (unittest runner) using {envpython}'
platform=
macos: darwin
Expand All @@ -70,13 +71,13 @@ commands =
echo "Starting {envname}"
{envpython} -V
{envpython} -m unittest discover -v --start-directory {[local_settings]test_path_1} --pattern "{[local_settings]test_pattern}"
{envpython} -m unittest discover -v --start-directory {[local_settings]test_path_2} --pattern "{[local_settings]test_pattern}"
{envpython} -m unittest discover -v --start-directory {[local_settings]test_path_3} --pattern "{[local_settings]test_pattern}"
{envpython} -m unittest discover -v --start-directory {[local_settings]test_path_4} --pattern "{[local_settings]test_pattern}"
# {envpython} -m unittest discover -v --start-directory {[local_settings]test_path_2} --pattern "{[local_settings]test_pattern}"
# {envpython} -m unittest discover -v --start-directory {[local_settings]test_path_3} --pattern "{[local_settings]test_pattern}"
# {envpython} -m unittest discover -v --start-directory {[local_settings]test_path_4} --pattern "{[local_settings]test_pattern}"
echo "Completed {envname}"

#
[testenv:format_pep8-py3{9,10,11,12}]
[testenv:format_pep8-py3{9,10,11,12,13}]
description = 'Run selected PEP8 compliance checks (flake8)'
platform=
macos: darwin
Expand All @@ -92,7 +93,7 @@ commands =
flake8 --max-line-length=185 --ignore=D,I,E203,W503,E501 {[local_settings]source_paths} {[local_settings]flake_exclude_paths}

#
[testenv:lint_pylint-py3{9,10,11,12}]
[testenv:lint_pylint-py3{9,10,11,12,13}]
description = 'Run linting compliance checks (pylint)'
platform=
macos: darwin
Expand All @@ -107,7 +108,7 @@ commands =
echo "Completed {envname}"

#
[testenv:format_black-py3{9,10,11,12}]
[testenv:format_black-py3{9,10,11,12,13}]
description = 'Run format compliance checks (black)'
platform=
macos: darwin
Expand All @@ -123,7 +124,7 @@ commands =
echo "Completed {envname}"

#
[testenv:test_coverage-py3{9,10,11,12}]
[testenv:test_coverage-py3{9,10,11,12,13}]
description = 'Run test coverage analysis'
platform=
macos: darwin
Expand All @@ -138,9 +139,9 @@ commands =
echo "Starting {envname}"
coverage erase
coverage run --parallel-mode --omit="{[local_settings]coverage_exclude_paths}" --source="{[local_settings]coverage_source_paths}" -m unittest discover -v --start-directory {[local_settings]test_path_1} --pattern "{[local_settings]test_pattern}"
coverage run --parallel-mode --omit="{[local_settings]coverage_exclude_paths}" --source="{[local_settings]coverage_source_paths}" -m unittest discover -v --start-directory {[local_settings]test_path_2} --pattern "{[local_settings]test_pattern}"
coverage run --parallel-mode --omit="{[local_settings]coverage_exclude_paths}" --source="{[local_settings]coverage_source_paths}" -m unittest discover -v --start-directory {[local_settings]test_path_3} --pattern "{[local_settings]test_pattern}"
coverage run --parallel-mode --omit="{[local_settings]coverage_exclude_paths}" --source="{[local_settings]coverage_source_paths}" -m unittest discover -v --start-directory {[local_settings]test_path_4} --pattern "{[local_settings]test_pattern}"
# coverage run --parallel-mode --omit="{[local_settings]coverage_exclude_paths}" --source="{[local_settings]coverage_source_paths}" -m unittest discover -v --start-directory {[local_settings]test_path_2} --pattern "{[local_settings]test_pattern}"
# coverage run --parallel-mode --omit="{[local_settings]coverage_exclude_paths}" --source="{[local_settings]coverage_source_paths}" -m unittest discover -v --start-directory {[local_settings]test_path_3} --pattern "{[local_settings]test_pattern}"
# coverage run --parallel-mode --omit="{[local_settings]coverage_exclude_paths}" --source="{[local_settings]coverage_source_paths}" -m unittest discover -v --start-directory {[local_settings]test_path_4} --pattern "{[local_settings]test_pattern}"
echo " ------- Consolidating {envname} data ----------"
coverage combine
echo " ------- Building {envname} reports ----------"
Expand Down
2 changes: 1 addition & 1 deletion wwpdb/apps/seqmodule/util/SequenceLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def updateAuth(self, authFD, refFD):
authFD["SOURCE_COMMON_NAME"] = common_name
#
#
excludedList = [ "PREDICTED PROTEIN", "PROTEIN OF UNCHARACTERIZED FUNCTION", "UNCHARACTERIZED CONSERVED PROTEIN", "UNCHARACTERIZED PROTEIN" ]
excludedList = ["PREDICTED PROTEIN", "PROTEIN OF UNCHARACTERIZED FUNCTION", "UNCHARACTERIZED CONSERVED PROTEIN", "UNCHARACTERIZED PROTEIN"]
#
for mapTup in mapTupList:
if mapTup[0] == "ENTITY_DESCRIPTION":
Expand Down

0 comments on commit ff74780

Please sign in to comment.