circup 2.2.1__py3-none-any.whl → 2.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- circup/command_utils.py +29 -7
- circup/config/bundle_config.json +1 -2
- {circup-2.2.1.dist-info → circup-2.2.3.dist-info}/METADATA +1 -1
- {circup-2.2.1.dist-info → circup-2.2.3.dist-info}/RECORD +8 -8
- {circup-2.2.1.dist-info → circup-2.2.3.dist-info}/WHEEL +1 -1
- {circup-2.2.1.dist-info → circup-2.2.3.dist-info}/entry_points.txt +0 -0
- {circup-2.2.1.dist-info → circup-2.2.3.dist-info}/licenses/LICENSE +0 -0
- {circup-2.2.1.dist-info → circup-2.2.3.dist-info}/top_level.txt +0 -0
circup/command_utils.py
CHANGED
|
@@ -673,14 +673,15 @@ def imports_from_code(full_content):
|
|
|
673
673
|
return sorted(imports)
|
|
674
674
|
|
|
675
675
|
|
|
676
|
-
def get_all_imports(
|
|
677
|
-
backend, auto_file_content, mod_names, current_module, visited=None
|
|
676
|
+
def get_all_imports( # pylint: disable=too-many-arguments,too-many-locals, too-many-branches
|
|
677
|
+
backend, auto_file_content, auto_file_path, mod_names, current_module, visited=None
|
|
678
678
|
):
|
|
679
679
|
"""
|
|
680
680
|
Recursively retrieve imports from files on the backend
|
|
681
681
|
|
|
682
682
|
:param Backend backend: The current backend object
|
|
683
683
|
:param str auto_file_content: Content of the python file to analyse
|
|
684
|
+
:param str auto_file_path: Path to the python file to analyse
|
|
684
685
|
:param list mod_names: Lits of supported bundle mod names
|
|
685
686
|
:param str current_module: Name of the call context module if recursive call
|
|
686
687
|
:param set visited: Modules previously visited
|
|
@@ -714,18 +715,37 @@ def get_all_imports(
|
|
|
714
715
|
install_module = install
|
|
715
716
|
# possible files for the module: .py or __init__.py (if directory)
|
|
716
717
|
file_name = os.path.join(*install_module.split(".")) + ".py"
|
|
717
|
-
|
|
718
|
+
try:
|
|
719
|
+
file_location = os.path.join(
|
|
720
|
+
*auto_file_path.replace(str(backend.device_location), "").split(
|
|
721
|
+
"/"
|
|
722
|
+
)[:-1]
|
|
723
|
+
)
|
|
724
|
+
|
|
725
|
+
full_location = os.path.join(file_location, file_name)
|
|
726
|
+
|
|
727
|
+
except TypeError:
|
|
728
|
+
# file is in root of CIRCUITPY
|
|
729
|
+
full_location = file_name
|
|
730
|
+
|
|
731
|
+
exists = backend.file_exists(full_location)
|
|
718
732
|
if not exists:
|
|
719
733
|
file_name = os.path.join(*install_module.split("."), "__init__.py")
|
|
720
|
-
|
|
734
|
+
full_location = file_name
|
|
735
|
+
exists = backend.file_exists(full_location)
|
|
721
736
|
if not exists:
|
|
722
737
|
continue
|
|
723
738
|
install_module += ".__init__"
|
|
724
739
|
# get the content and parse it recursively
|
|
725
|
-
auto_file_content = backend.get_file_content(
|
|
740
|
+
auto_file_content = backend.get_file_content(full_location)
|
|
726
741
|
if auto_file_content:
|
|
727
742
|
sub_imports = get_all_imports(
|
|
728
|
-
backend,
|
|
743
|
+
backend,
|
|
744
|
+
auto_file_content,
|
|
745
|
+
auto_file_path,
|
|
746
|
+
mod_names,
|
|
747
|
+
install_module,
|
|
748
|
+
visited,
|
|
729
749
|
)
|
|
730
750
|
requested_installs.extend(sub_imports)
|
|
731
751
|
|
|
@@ -775,7 +795,9 @@ def libraries_from_auto_file(backend, auto_file, mod_names):
|
|
|
775
795
|
# from file name to module name (in case it's in a subpackage)
|
|
776
796
|
click.secho(f"Finding imports from: {auto_file}", fg="green")
|
|
777
797
|
current_module = auto_file.rstrip(".py").replace(os.path.sep, ".")
|
|
778
|
-
return get_all_imports(
|
|
798
|
+
return get_all_imports(
|
|
799
|
+
backend, auto_file_content, auto_file, mod_names, current_module
|
|
800
|
+
)
|
|
779
801
|
|
|
780
802
|
|
|
781
803
|
def get_device_path(host, port, password, path):
|
circup/config/bundle_config.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
circup/__init__.py,sha256=9A98U3DyA14tm-7_d88fGSlLfEKz9T_85t8kXkErqRg,662
|
|
2
2
|
circup/backends.py,sha256=g9Q9xCGZidwsEDL2Ga2cm50YYB54IiqlKUPcxj-pWZA,40008
|
|
3
3
|
circup/bundle.py,sha256=FEP4F470aJtwmm8jgTM3DgR3dj5SVwbX1tbyIRKVHn8,5327
|
|
4
|
-
circup/command_utils.py,sha256=
|
|
4
|
+
circup/command_utils.py,sha256=o-Qdl868OidXqw_2Zs0uzsZAT9swqaYhtWrndcqEcgw,30157
|
|
5
5
|
circup/commands.py,sha256=1UQ8EONlcEFQsytPO3LAHLcNHZIO0Fi5XCU47quzt08,27436
|
|
6
6
|
circup/logging.py,sha256=hu4v8ljkXo8ru-cqs0W3PU-xEVvTO_qqMKDJM18OXbQ,1115
|
|
7
7
|
circup/module.py,sha256=33_kdy5BZn6COyIjAFZMpw00rTtPiryQZWFXQkMF8FY,7435
|
|
8
8
|
circup/shared.py,sha256=IBW3v0rry1wLr8yR8_xHfe0QC5SFGzv6bdnPv96vZaM,8944
|
|
9
|
-
circup/config/bundle_config.json,sha256=
|
|
9
|
+
circup/config/bundle_config.json,sha256=zzpmfy0jD7TxpOOw2P_gqIISuMBG0enb_f3_VneQ5mI,135
|
|
10
10
|
circup/config/bundle_config.json.license,sha256=OOHNqDsViGFhmG9z8J0o98hYmub1CkYKiZB96Php6KE,80
|
|
11
11
|
circup/wwshell/README.rst,sha256=M_jFP0hwOcngF0RdosdeqmVOISNcPzyjTW3duzIu9A8,3617
|
|
12
12
|
circup/wwshell/README.rst.license,sha256=GhA0SoZGP7CReDam-JJk_UtIQIpQaZWQFzR26YSuMm4,107
|
|
13
13
|
circup/wwshell/__init__.py,sha256=CAPZiYrouWboyPx4KiWLBG_vf_n0MmArGqaFyTXGKWk,398
|
|
14
14
|
circup/wwshell/commands.py,sha256=-I5l7XeoDmvWWuZg5wHdt9qe__SBQ1EGmKwCDTBMeus,7454
|
|
15
|
-
circup-2.2.
|
|
16
|
-
circup-2.2.
|
|
17
|
-
circup-2.2.
|
|
18
|
-
circup-2.2.
|
|
19
|
-
circup-2.2.
|
|
20
|
-
circup-2.2.
|
|
15
|
+
circup-2.2.3.dist-info/licenses/LICENSE,sha256=bVlIMmSL_pqLCqae4hzixy9pYXD808IbgsMoQXTNLBk,1076
|
|
16
|
+
circup-2.2.3.dist-info/METADATA,sha256=DX5Y0xFJa3RwpnTOA8L01eVtCGbNg3rPAgsYiN_Us98,13617
|
|
17
|
+
circup-2.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
18
|
+
circup-2.2.3.dist-info/entry_points.txt,sha256=FjTmwYD_ApgLRGifUrr_Ui1voW6fEzodQc3DKNzoAPc,69
|
|
19
|
+
circup-2.2.3.dist-info/top_level.txt,sha256=Qx6E0eZgSBE10ciNKsLZx8-TTy_9fEVZh7NLmn24KcU,7
|
|
20
|
+
circup-2.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|