Refactor: Replace wildcard imports with explicit imports in integration test files#3513
Draft
Refactor: Replace wildcard imports with explicit imports in integration test files#3513
Conversation
Replace `from env_indigo import *` with explicit named imports in all files listed in the issue. Standard library modules (os, sys, etc.) that are already directly imported are not redundantly imported from env_indigo. Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Import threading directly as a standard library module instead of getting it through env_indigo in threads_test.py, molfile_stereo_desc.py, and ketfile_stereo_desc.py. Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor to remove wildcard imports
Refactor: Replace wildcard imports with explicit imports in integration test files
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generic request
#1234 – issue nameOptional
Description
Replace
from env_indigo import *with explicit named imports across 100 test files underapi/tests/integration/tests/.env_indigonames each file actually usesos,sys,threading) already imported directly are not re-imported fromenv_indigothreadingto directimport threadingin 4 files that previously obtained it through the wildcardImport style:
Only files listed in the issue were modified.
deco/extract_scaffold.py(not in scope) is unchanged.Original prompt
This section details on the original issue you should resolve
<issue_title>Refactor: Wildcard imports should not be used</issue_title>
<issue_description>Problem:
Import only needed names or import the module and then use its members.
Why is this an issue?
Importing every public name from a module using a wildcard (from mymodule import *) is a bad idea because:
Remember that imported names can change when you update your dependencies. A wildcard import that works today might be broken tomorrow.
Exceptions
No issue will be raised in
__init__.pyfiles. Wildcard imports are a common way of populating these modules.No issue will be raised in modules doing only imports. Local modules are sometimes created as a proxy for third-party modules.
Just keep in mind that wildcard imports might still create issues in these cases. It’s always better to import only what you need.
How can I fix it?
There are two ways to avoid a wildcard import:
Noncompliant code example
Compliant solution
Or
NOTE: Resulted code shoul follow clang-format formating.
Problem locations:
api/tests/integration/tests/aam/aam_access.py
api/tests/integration/tests/aam/aam_basic.py
api/tests/integration/tests/aam/aam_hard.py
api/tests/integration/tests/arom/arom_d_orbital.py
api/tests/integration/tests/arom/arom_merge.py
api/tests/integration/tests/arom/basic.py
api/tests/integration/tests/arom/elements.py
api/tests/integration/tests/arom/extended.py
api/tests/integration/tests/arom/partial_arom_cano.py
api/tests/integration/tests/arom/query_dearom.py
api/tests/integration/tests/basic/allenes.py
api/tests/integration/tests/basic/atom_bond_indicies.py
api/tests/integration/tests/basic/attachment_points.py
api/tests/integration/tests/basic/badval_smiles.py
api/tests/integration/tests/basic/basic.py
api/tests/integration/tests/basic/basic_check.py
api/tests/integration/tests/basic/basic_load.py
api/tests/integration/tests/basic/buffer_string_load_iterate.py
api/tests/integration/tests/basic/check_query.py
api/tests/integration/tests/basic/chiral_test.py
api/tests/integration/tests/basic/cis_trans.py
api/tests/integration/tests/basic/components.py
api/tests/integration/tests/basic/create_query.py
api/tests/integration/tests/basic/debug.py
api/tests/integration/tests/basic/exceptions.py
api/tests/integration/tests/basic/fischer_proj.py
api/tests/integration/tests/basic/fold_then_smiles.py
api/tests/integration/tests/basic/fold_unfold.py
api/tests/integration/tests/basic/get_original_format.py
api/tests/integration/tests/basic/hash.py
api/tests/integration/tests/basic/highlighting.py
api/tests/integration/tests/basic/hybridization.py
api/tests/integration/tests/basic/imp_h_test.py
api/tests/integration/tests/basic/imp_h_test_ket.py
api/tests/integration/tests/basic/ketfile_stereo_desc.py
api/tests/integration/tests/basic/leak.py
api/tests/integration/tests/basic/load.py
api/tests/integration/tests/basic/load_dearom_save.py
api/tests/integration/tests/basic/load_structure.py
api/tests/integration/tests/basic/molfile_stereo_desc.py
api/tests/integration/tests/basic/molfile_stereoparity.py
api/tests/integration/tests/basic/multiple_instances.py
api/tests/integration/tests/basic/murcko.py
api/tests/integration/tests/basic/options.py
api/tests/integration/tests/basic/properties.py
api/tests/integration/tests/basic/pseudoatoms.py
api/tests/integration/tests/basic/query_instrumentation.py
api/tests/integration/tests/basic/radicals.py
api/tests/integration/tests/basic/reaction_instrumentation.py
api/tests/integration/tests/basic/reaction_saveload.py
api/tests/integration/tests/basic/rings.py
api/tests/integration/tests/basic/rsite.py
api/tests/integration/tests/basic/savers.py
api/tests/integration/tests/basic/scsr_basic.py
api/tests/integration/tests/basic/scsr_instrumentation.py
api/tests/integration/tests/basic/set_charge.py
api/tests/integration/tests/basic/sssr.py
api/tests/integration/tests/basic/stereo_test.py
api/test...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.