circup 2.2.2__tar.gz → 2.2.3__tar.gz

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.
Files changed (93) hide show
  1. {circup-2.2.2/circup.egg-info → circup-2.2.3}/PKG-INFO +1 -1
  2. {circup-2.2.2 → circup-2.2.3}/circup/command_utils.py +29 -7
  3. {circup-2.2.2 → circup-2.2.3/circup.egg-info}/PKG-INFO +1 -1
  4. {circup-2.2.2 → circup-2.2.3}/circup.egg-info/SOURCES.txt +4 -0
  5. circup-2.2.3/tests/mock_device/apps/test_app/import_styles.py +11 -0
  6. circup-2.2.3/tests/mock_device/import_styles.py +11 -0
  7. circup-2.2.3/tests/mock_device/import_styles_sub.py +5 -0
  8. {circup-2.2.2 → circup-2.2.3}/tests/mock_device_2/boot_out.txt +1 -1
  9. circup-2.2.3/tests/mock_device_2/import_styles_sub.py +5 -0
  10. {circup-2.2.2 → circup-2.2.3}/tests/test_circup.py +9 -2
  11. {circup-2.2.2 → circup-2.2.3}/.github/ISSUE_TEMPLATE.md +0 -0
  12. {circup-2.2.2 → circup-2.2.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  13. {circup-2.2.2 → circup-2.2.3}/.github/workflows/build.yml +0 -0
  14. {circup-2.2.2 → circup-2.2.3}/.github/workflows/release.yml +0 -0
  15. {circup-2.2.2 → circup-2.2.3}/.gitignore +0 -0
  16. {circup-2.2.2 → circup-2.2.3}/.isort.cfg +0 -0
  17. {circup-2.2.2 → circup-2.2.3}/.pre-commit-config.yaml +0 -0
  18. {circup-2.2.2 → circup-2.2.3}/.pylintrc +0 -0
  19. {circup-2.2.2 → circup-2.2.3}/CODE_OF_CONDUCT.rst +0 -0
  20. {circup-2.2.2 → circup-2.2.3}/CODE_OF_CONDUCT.rst.license +0 -0
  21. {circup-2.2.2 → circup-2.2.3}/CONTRIBUTING.rst +0 -0
  22. {circup-2.2.2 → circup-2.2.3}/CONTRIBUTING.rst.license +0 -0
  23. {circup-2.2.2 → circup-2.2.3}/LICENSE +0 -0
  24. {circup-2.2.2 → circup-2.2.3}/LICENSES/CC-BY-4.0.txt +0 -0
  25. {circup-2.2.2 → circup-2.2.3}/LICENSES/MIT.txt +0 -0
  26. {circup-2.2.2 → circup-2.2.3}/LICENSES/Unlicense.txt +0 -0
  27. {circup-2.2.2 → circup-2.2.3}/README.rst +0 -0
  28. {circup-2.2.2 → circup-2.2.3}/README.rst.license +0 -0
  29. {circup-2.2.2 → circup-2.2.3}/circup/__init__.py +0 -0
  30. {circup-2.2.2 → circup-2.2.3}/circup/backends.py +0 -0
  31. {circup-2.2.2 → circup-2.2.3}/circup/bundle.py +0 -0
  32. {circup-2.2.2 → circup-2.2.3}/circup/commands.py +0 -0
  33. {circup-2.2.2 → circup-2.2.3}/circup/config/bundle_config.json +0 -0
  34. {circup-2.2.2 → circup-2.2.3}/circup/config/bundle_config.json.license +0 -0
  35. {circup-2.2.2 → circup-2.2.3}/circup/logging.py +0 -0
  36. {circup-2.2.2 → circup-2.2.3}/circup/module.py +0 -0
  37. {circup-2.2.2 → circup-2.2.3}/circup/shared.py +0 -0
  38. {circup-2.2.2 → circup-2.2.3}/circup/wwshell/README.rst +0 -0
  39. {circup-2.2.2 → circup-2.2.3}/circup/wwshell/README.rst.license +0 -0
  40. {circup-2.2.2 → circup-2.2.3}/circup/wwshell/__init__.py +0 -0
  41. {circup-2.2.2 → circup-2.2.3}/circup/wwshell/commands.py +0 -0
  42. {circup-2.2.2 → circup-2.2.3}/circup.egg-info/dependency_links.txt +0 -0
  43. {circup-2.2.2 → circup-2.2.3}/circup.egg-info/entry_points.txt +0 -0
  44. {circup-2.2.2 → circup-2.2.3}/circup.egg-info/requires.txt +0 -0
  45. {circup-2.2.2 → circup-2.2.3}/circup.egg-info/top_level.txt +0 -0
  46. {circup-2.2.2 → circup-2.2.3}/docs/_static/favicon.ico +0 -0
  47. {circup-2.2.2 → circup-2.2.3}/docs/_static/favicon.ico.license +0 -0
  48. {circup-2.2.2 → circup-2.2.3}/docs/conf.py +0 -0
  49. {circup-2.2.2 → circup-2.2.3}/docs/index.rst +0 -0
  50. {circup-2.2.2 → circup-2.2.3}/docs/index.rst.license +0 -0
  51. {circup-2.2.2 → circup-2.2.3}/docs/logo.png +0 -0
  52. {circup-2.2.2 → circup-2.2.3}/docs/logo.png.license +0 -0
  53. {circup-2.2.2 → circup-2.2.3}/optional_requirements.txt +0 -0
  54. {circup-2.2.2 → circup-2.2.3}/optional_requirements.txt.license +0 -0
  55. {circup-2.2.2 → circup-2.2.3}/pyproject.toml +0 -0
  56. {circup-2.2.2 → circup-2.2.3}/readthedocs.yml +0 -0
  57. {circup-2.2.2 → circup-2.2.3}/requirements.txt +0 -0
  58. {circup-2.2.2 → circup-2.2.3}/requirements.txt.license +0 -0
  59. {circup-2.2.2 → circup-2.2.3}/setup.cfg +0 -0
  60. {circup-2.2.2 → circup-2.2.3}/tests/__init__.py +0 -0
  61. {circup-2.2.2 → circup-2.2.3}/tests/bad_module/__init__.py +0 -0
  62. {circup-2.2.2 → circup-2.2.3}/tests/bad_module/my_module.py +0 -0
  63. {circup-2.2.2 → circup-2.2.3}/tests/bad_python.py +0 -0
  64. {circup-2.2.2 → circup-2.2.3}/tests/bundle.json +0 -0
  65. {circup-2.2.2 → circup-2.2.3}/tests/bundle.json.license +0 -0
  66. {circup-2.2.2 → circup-2.2.3}/tests/device.json +0 -0
  67. {circup-2.2.2 → circup-2.2.3}/tests/device.json.license +0 -0
  68. {circup-2.2.2 → circup-2.2.3}/tests/dir_module/__init__.py +0 -0
  69. {circup-2.2.2 → circup-2.2.3}/tests/dir_module/my_module.py +0 -0
  70. {circup-2.2.2 → circup-2.2.3}/tests/import_styles.py +0 -0
  71. {circup-2.2.2 → circup-2.2.3}/tests/local_module.py +0 -0
  72. {circup-2.2.2 → circup-2.2.3}/tests/local_module_cp7.mpy +0 -0
  73. {circup-2.2.2 → circup-2.2.3}/tests/local_module_cp7.mpy.license +0 -0
  74. {circup-2.2.2/tests/mock_device → circup-2.2.3/tests/mock_device/apps/test_app}/import_styles_sub.py +0 -0
  75. {circup-2.2.2 → circup-2.2.3}/tests/mock_device/boot_out.txt +0 -0
  76. {circup-2.2.2 → circup-2.2.3}/tests/mock_device/boot_out.txt.license +0 -0
  77. {circup-2.2.2 → circup-2.2.3}/tests/mock_device/lib/adafruit_waveform/.gitkeep +0 -0
  78. {circup-2.2.2 → circup-2.2.3}/tests/mock_device_2/.gitignore +0 -0
  79. {circup-2.2.2 → circup-2.2.3}/tests/mock_device_2/boot_out.txt.license +0 -0
  80. {circup-2.2.2 → circup-2.2.3}/tests/mock_device_2/code.py +0 -0
  81. {circup-2.2.2 → circup-2.2.3}/tests/mock_device_2/package/__init__.py +0 -0
  82. {circup-2.2.2 → circup-2.2.3}/tests/mock_device_2/package/other.py +0 -0
  83. {circup-2.2.2 → circup-2.2.3}/tests/mount_exists.txt +0 -0
  84. {circup-2.2.2 → circup-2.2.3}/tests/mount_exists.txt.license +0 -0
  85. {circup-2.2.2 → circup-2.2.3}/tests/mount_missing.txt +0 -0
  86. {circup-2.2.2 → circup-2.2.3}/tests/mount_missing.txt.license +0 -0
  87. {circup-2.2.2 → circup-2.2.3}/tests/remote_module.py +0 -0
  88. {circup-2.2.2 → circup-2.2.3}/tests/test_bundle_config.json +0 -0
  89. {circup-2.2.2 → circup-2.2.3}/tests/test_bundle_config.json.license +0 -0
  90. {circup-2.2.2 → circup-2.2.3}/tests/test_bundle_config_local.json +0 -0
  91. {circup-2.2.2 → circup-2.2.3}/tests/test_bundle_config_local.json.license +0 -0
  92. {circup-2.2.2 → circup-2.2.3}/tests/test_module.mpy +0 -0
  93. {circup-2.2.2 → circup-2.2.3}/tests/test_module.mpy.license +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: circup
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: A tool to manage/update libraries on CircuitPython devices.
5
5
  Author-email: Adafruit Industries <circuitpython@adafruit.com>
6
6
  License: MIT License
@@ -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
- exists = backend.file_exists(file_name)
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
- exists = backend.file_exists(file_name)
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(file_name)
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, auto_file_content, mod_names, install_module, visited
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(backend, auto_file_content, mod_names, current_module)
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: circup
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: A tool to manage/update libraries on CircuitPython devices.
5
5
  Author-email: Adafruit Industries <circuitpython@adafruit.com>
6
6
  License: MIT License
@@ -77,11 +77,15 @@ tests/dir_module/__init__.py
77
77
  tests/dir_module/my_module.py
78
78
  tests/mock_device/boot_out.txt
79
79
  tests/mock_device/boot_out.txt.license
80
+ tests/mock_device/import_styles.py
80
81
  tests/mock_device/import_styles_sub.py
82
+ tests/mock_device/apps/test_app/import_styles.py
83
+ tests/mock_device/apps/test_app/import_styles_sub.py
81
84
  tests/mock_device/lib/adafruit_waveform/.gitkeep
82
85
  tests/mock_device_2/.gitignore
83
86
  tests/mock_device_2/boot_out.txt
84
87
  tests/mock_device_2/boot_out.txt.license
85
88
  tests/mock_device_2/code.py
89
+ tests/mock_device_2/import_styles_sub.py
86
90
  tests/mock_device_2/package/__init__.py
87
91
  tests/mock_device_2/package/other.py
@@ -0,0 +1,11 @@
1
+ # SPDX-FileCopyrightText: 2021 Jeff Epler for Adafruit Industries
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ # pylint: disable=all
5
+ import os, sys
6
+ import adafruit_bus_device
7
+ from adafruit_button import Button
8
+ from adafruit_esp32spi import adafruit_esp32spi_socketpool
9
+ from adafruit_display_text import wrap_text_to_pixels, wrap_text_to_lines
10
+ import adafruit_hid.consumer_control
11
+ import import_styles_sub
@@ -0,0 +1,11 @@
1
+ # SPDX-FileCopyrightText: 2021 Jeff Epler for Adafruit Industries
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ # pylint: disable=all
5
+ import os, sys
6
+ import adafruit_bus_device
7
+ from adafruit_button import Button
8
+ from adafruit_esp32spi import adafruit_esp32spi_socketpool
9
+ from adafruit_display_text import wrap_text_to_pixels, wrap_text_to_lines
10
+ import adafruit_hid.consumer_control
11
+ import import_styles_sub
@@ -0,0 +1,5 @@
1
+ # SPDX-FileCopyrightText: 2025 Neradoc
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ # pylint: disable=all
5
+ import adafruit_ntp
@@ -1,3 +1,3 @@
1
- Adafruit CircuitPython 8.1.0 on 2019-08-02; Adafruit CircuitPlayground Express with samd21g18
1
+ Adafruit CircuitPython 9.0.0 on 2019-08-02; Adafruit CircuitPlayground Express with samd21g18
2
2
  Board ID:this_is_a_board
3
3
  UID:AAAABBBBCCCC
@@ -0,0 +1,5 @@
1
+ # SPDX-FileCopyrightText: 2025 Neradoc
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ # pylint: disable=all
5
+ import adafruit_ntp
@@ -1185,7 +1185,13 @@ def test_get_all_imports():
1185
1185
  with open(test_file, "r", encoding="utf8") as fp:
1186
1186
  test_data = fp.read()
1187
1187
 
1188
- result = get_all_imports(backend, test_data, mod_names, current_module="")
1188
+ result = get_all_imports(
1189
+ backend,
1190
+ test_data,
1191
+ os.path.join(backend.device_location, "import_styles.py"),
1192
+ mod_names,
1193
+ current_module="",
1194
+ )
1189
1195
 
1190
1196
  assert result == [
1191
1197
  "adafruit_bus_device",
@@ -1213,7 +1219,7 @@ def test_libraries_from_auto_file_local():
1213
1219
  "adafruit_ntp",
1214
1220
  ]
1215
1221
 
1216
- auto_file = "./tests/import_styles.py"
1222
+ auto_file = "apps/test_app/import_styles.py"
1217
1223
 
1218
1224
  with mock.patch("circup.logger.info") as mock_logger, mock.patch(
1219
1225
  "circup.os.path.isfile", return_value=True
@@ -1265,6 +1271,7 @@ def test_libraries_from_auto_file_board():
1265
1271
  result = libraries_from_auto_file(backend, auto_file, mod_names)
1266
1272
 
1267
1273
  assert result == [
1274
+ "adafruit_ntp",
1268
1275
  "adafruit_spd1608",
1269
1276
  "adafruit_spd1656",
1270
1277
  "adafruit_ssd1675",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes