From 6aaad4b4eb29ee0bb5c26a422a6274aa428aa51f Mon Sep 17 00:00:00 2001 From: David Mejia Date: Fri, 27 Oct 2023 18:40:21 -0400 Subject: [PATCH 1/2] upgade isort to 5.11.5 --- .pre-commit-config.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 381082dd2..fb7ee4a29 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,10 +15,11 @@ repos: # - id: check-docstring-first # We can enable this rule once models.py is simplified - id: check-yaml - - repo: https://github.com/pre-commit/mirrors-isort - rev: v4.3.21 + - repo: https://github.com/pycqa/isort + rev: 5.11.5 hooks: - id: isort + name: isort (python) - repo: https://github.com/psf/black rev: 22.3.0 From 851d5a0c29442f52e595c1002298add6afd2fe4c Mon Sep 17 00:00:00 2001 From: David Mejia Date: Fri, 27 Oct 2023 18:49:19 -0400 Subject: [PATCH 2/2] run isort globally --- api/tests/test_imports.py | 2 +- foreman/tests/test_imports.py | 55 ++++++++++++----------- workers/tests/downloaders/test_imports.py | 10 +++-- workers/tests/processors/test_smasher.py | 4 +- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/api/tests/test_imports.py b/api/tests/test_imports.py index c7048c3b3..d68730e68 100644 --- a/api/tests/test_imports.py +++ b/api/tests/test_imports.py @@ -5,6 +5,7 @@ class ImportTestCase(TestCase): def test_imports(self): # Make sure we can import the api tests import tests.management.commands.test_post_downloads_summary + import tests.test_sentry_middleware import tests.views.test_api_general import tests.views.test_compendia import tests.views.test_dataset @@ -12,5 +13,4 @@ def test_imports(self): import tests.views.test_processor import tests.views.test_qn_target import tests.views.test_search - import tests.test_sentry_middleware import tests.views.test_stats diff --git a/foreman/tests/test_imports.py b/foreman/tests/test_imports.py index 1544f77d9..d663e0200 100644 --- a/foreman/tests/test_imports.py +++ b/foreman/tests/test_imports.py @@ -4,6 +4,34 @@ class ImportTestCase(TestCase): def test_imports(self): # Make sure we can import the foreman tests + import tests.foreman.management.commands.test_correct_affy_cdfs + import tests.foreman.management.commands.test_create_compendia + import tests.foreman.management.commands.test_create_missing_downloader_jobs + import tests.foreman.management.commands.test_create_missing_processor_jobs + import tests.foreman.management.commands.test_create_quantpendia + import tests.foreman.management.commands.test_import_external_sample_attributes + import tests.foreman.management.commands.test_import_external_sample_keywords + import tests.foreman.management.commands.test_organism_shepherd + import tests.foreman.management.commands.test_rerun_salmon_old_samples + import tests.foreman.management.commands.test_retry_samples + import tests.foreman.management.commands.test_run_tximport + import tests.foreman.management.commands.test_update_experiment_metadata + import tests.foreman.test_downloader_job_manager + import tests.foreman.test_end_to_end + import tests.foreman.test_job_control + import tests.foreman.test_job_requeuing + import tests.foreman.test_processor_job_manager + import tests.foreman.test_survey_job_manager + import tests.surveyor.management.commands.test_unsurvey + import tests.surveyor.test_array_express + import tests.surveyor.test_external_source + import tests.surveyor.test_geo + import tests.surveyor.test_harmony + import tests.surveyor.test_sra + import tests.surveyor.test_surveyor + import tests.surveyor.test_transcriptome_index + import tests.surveyor.test_utils + import data_refinery_foreman.foreman.management.commands.check_computed_files import data_refinery_foreman.foreman.management.commands.check_missing_results import data_refinery_foreman.foreman.management.commands.correct_affy_cdfs @@ -32,30 +60,3 @@ def test_imports(self): import data_refinery_foreman.foreman.management.commands.update_experiment_metadata import data_refinery_foreman.foreman.management.commands.update_sample_metadata import data_refinery_foreman.foreman.utils - import tests.foreman.management.commands.test_correct_affy_cdfs - import tests.foreman.management.commands.test_create_compendia - import tests.foreman.management.commands.test_create_missing_downloader_jobs - import tests.foreman.management.commands.test_create_missing_processor_jobs - import tests.foreman.management.commands.test_create_quantpendia - import tests.foreman.management.commands.test_import_external_sample_attributes - import tests.foreman.management.commands.test_import_external_sample_keywords - import tests.foreman.management.commands.test_organism_shepherd - import tests.foreman.management.commands.test_rerun_salmon_old_samples - import tests.foreman.management.commands.test_retry_samples - import tests.foreman.management.commands.test_run_tximport - import tests.foreman.management.commands.test_update_experiment_metadata - import tests.foreman.test_downloader_job_manager - import tests.foreman.test_end_to_end - import tests.foreman.test_job_control - import tests.foreman.test_job_requeuing - import tests.foreman.test_processor_job_manager - import tests.foreman.test_survey_job_manager - import tests.surveyor.management.commands.test_unsurvey - import tests.surveyor.test_array_express - import tests.surveyor.test_external_source - import tests.surveyor.test_geo - import tests.surveyor.test_harmony - import tests.surveyor.test_sra - import tests.surveyor.test_surveyor - import tests.surveyor.test_utils - import tests.surveyor.test_transcriptome_index diff --git a/workers/tests/downloaders/test_imports.py b/workers/tests/downloaders/test_imports.py index 2b2195574..6f020ff4f 100644 --- a/workers/tests/downloaders/test_imports.py +++ b/workers/tests/downloaders/test_imports.py @@ -5,7 +5,9 @@ class ImportTestCase(TestCase): @tag("downloaders") def test_downloader_imports(self): # Make sure we can import the downloader tests. - from tests.downloaders import test_array_express - from tests.downloaders import test_geo - from tests.downloaders import test_sra - from tests.downloaders import test_transcriptome_index + from tests.downloaders import ( + test_array_express, + test_geo, + test_sra, + test_transcriptome_index, + ) diff --git a/workers/tests/processors/test_smasher.py b/workers/tests/processors/test_smasher.py index a1e8e2f72..1ff304e1f 100644 --- a/workers/tests/processors/test_smasher.py +++ b/workers/tests/processors/test_smasher.py @@ -1240,10 +1240,10 @@ def test_quant_sf_only_smash(self): def test_sanity_imports(self): """Sci imports can be tricky, make sure this works.""" - import numpy # noqa - import scipy # noqa import matplotlib # noqa + import numpy # noqa import pandas # noqa + import scipy # noqa import sklearn # noqa import sympy # noqa