Skip to content

Commit

Permalink
Merge pull request #73 from ericdill/beckermr-patch-1
Browse files Browse the repository at this point in the history
REF guard imports of flaky things
  • Loading branch information
ocefpaf authored Jul 21, 2022
2 parents 10ac6b4 + ab4b1cf commit b718f8f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion depfinder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from fnmatch import fnmatch

from .inspection import iterate_over_library, get_imported_libs
from .reports import report_conda_forge_names_from_import_map
from .utils import pkg_data

logger = logging.getLogger('depfinder')
Expand Down Expand Up @@ -249,6 +248,7 @@ def simple_import_search_conda_forge_import_map(path_to_source_code, builtins=No
for total_import in total_imports_list:
for name, md in total_import.items():
total_imports[name].update(md)
from .reports import report_conda_forge_names_from_import_map
imports, _, _ = report_conda_forge_names_from_import_map(
total_imports, builtin_modules=builtins, ignore=ignore
)
Expand Down Expand Up @@ -287,6 +287,7 @@ def simple_import_to_pkg_map(path_to_source_code, builtins=None, ignore=None, cu
for total_import in total_imports_list:
for name, md in total_import.items():
total_imports[name].update(md)
from .reports import report_conda_forge_names_from_import_map
_, _, import_to_artifact = report_conda_forge_names_from_import_map(
total_imports, builtin_modules=builtins, ignore=ignore
)
Expand Down
23 changes: 23 additions & 0 deletions news/imp.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* Moved imports of report functions to be guarded in order to make code more stable.

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
1 change: 1 addition & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ def test_simple_import_to_pkg_map():
'questionable': {'IPython.core.inputsplitter': {'ipython', 'autovizwidget'}},
'questionable no match': {},
'required': {'requests': {'apache-libcloud',
'arm_pyart',
'autovizwidget',
'dbxfs',
'google-api-core',
Expand Down

0 comments on commit b718f8f

Please sign in to comment.