circup 3.0.3__tar.gz → 3.1.0__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 (97) hide show
  1. {circup-3.0.3/circup.egg-info → circup-3.1.0}/PKG-INFO +1 -1
  2. {circup-3.0.3 → circup-3.1.0}/circup/backends.py +19 -0
  3. {circup-3.0.3 → circup-3.1.0}/circup/commands.py +5 -1
  4. {circup-3.0.3 → circup-3.1.0}/circup/shared.py +12 -3
  5. {circup-3.0.3 → circup-3.1.0}/circup/wwshell/README.rst +7 -4
  6. {circup-3.0.3 → circup-3.1.0}/circup/wwshell/commands.py +14 -1
  7. {circup-3.0.3 → circup-3.1.0/circup.egg-info}/PKG-INFO +1 -1
  8. {circup-3.0.3 → circup-3.1.0}/circup.egg-info/SOURCES.txt +2 -0
  9. circup-3.1.0/circup.egg-info/scm_file_list.json +91 -0
  10. circup-3.1.0/circup.egg-info/scm_version.json +8 -0
  11. {circup-3.0.3 → circup-3.1.0}/readthedocs.yml +0 -2
  12. {circup-3.0.3 → circup-3.1.0}/tests/test_circup.py +20 -1
  13. {circup-3.0.3 → circup-3.1.0}/.github/ISSUE_TEMPLATE.md +0 -0
  14. {circup-3.0.3 → circup-3.1.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  15. {circup-3.0.3 → circup-3.1.0}/.github/workflows/build.yml +0 -0
  16. {circup-3.0.3 → circup-3.1.0}/.github/workflows/release.yml +0 -0
  17. {circup-3.0.3 → circup-3.1.0}/.gitignore +0 -0
  18. {circup-3.0.3 → circup-3.1.0}/.isort.cfg +0 -0
  19. {circup-3.0.3 → circup-3.1.0}/.pre-commit-config.yaml +0 -0
  20. {circup-3.0.3 → circup-3.1.0}/.pylintrc +0 -0
  21. {circup-3.0.3 → circup-3.1.0}/CODE_OF_CONDUCT.rst +0 -0
  22. {circup-3.0.3 → circup-3.1.0}/CODE_OF_CONDUCT.rst.license +0 -0
  23. {circup-3.0.3 → circup-3.1.0}/CONTRIBUTING.rst +0 -0
  24. {circup-3.0.3 → circup-3.1.0}/CONTRIBUTING.rst.license +0 -0
  25. {circup-3.0.3 → circup-3.1.0}/LICENSE +0 -0
  26. {circup-3.0.3 → circup-3.1.0}/LICENSES/CC-BY-4.0.txt +0 -0
  27. {circup-3.0.3 → circup-3.1.0}/LICENSES/MIT.txt +0 -0
  28. {circup-3.0.3 → circup-3.1.0}/LICENSES/Unlicense.txt +0 -0
  29. {circup-3.0.3 → circup-3.1.0}/README.rst +0 -0
  30. {circup-3.0.3 → circup-3.1.0}/README.rst.license +0 -0
  31. {circup-3.0.3 → circup-3.1.0}/circup/__init__.py +0 -0
  32. {circup-3.0.3 → circup-3.1.0}/circup/bundle.py +0 -0
  33. {circup-3.0.3 → circup-3.1.0}/circup/command_utils.py +0 -0
  34. {circup-3.0.3 → circup-3.1.0}/circup/config/bundle_config.json +0 -0
  35. {circup-3.0.3 → circup-3.1.0}/circup/config/bundle_config.json.license +0 -0
  36. {circup-3.0.3 → circup-3.1.0}/circup/lazy_metadata.py +0 -0
  37. {circup-3.0.3 → circup-3.1.0}/circup/logging.py +0 -0
  38. {circup-3.0.3 → circup-3.1.0}/circup/module.py +0 -0
  39. {circup-3.0.3 → circup-3.1.0}/circup/wwshell/README.rst.license +0 -0
  40. {circup-3.0.3 → circup-3.1.0}/circup/wwshell/__init__.py +0 -0
  41. {circup-3.0.3 → circup-3.1.0}/circup.egg-info/dependency_links.txt +0 -0
  42. {circup-3.0.3 → circup-3.1.0}/circup.egg-info/entry_points.txt +0 -0
  43. {circup-3.0.3 → circup-3.1.0}/circup.egg-info/requires.txt +0 -0
  44. {circup-3.0.3 → circup-3.1.0}/circup.egg-info/top_level.txt +0 -0
  45. {circup-3.0.3 → circup-3.1.0}/docs/_static/favicon.ico +0 -0
  46. {circup-3.0.3 → circup-3.1.0}/docs/_static/favicon.ico.license +0 -0
  47. {circup-3.0.3 → circup-3.1.0}/docs/conf.py +0 -0
  48. {circup-3.0.3 → circup-3.1.0}/docs/index.rst +0 -0
  49. {circup-3.0.3 → circup-3.1.0}/docs/index.rst.license +0 -0
  50. {circup-3.0.3 → circup-3.1.0}/docs/logo.png +0 -0
  51. {circup-3.0.3 → circup-3.1.0}/docs/logo.png.license +0 -0
  52. {circup-3.0.3 → circup-3.1.0}/docs/requirements.txt +0 -0
  53. {circup-3.0.3 → circup-3.1.0}/optional_requirements.txt +0 -0
  54. {circup-3.0.3 → circup-3.1.0}/optional_requirements.txt.license +0 -0
  55. {circup-3.0.3 → circup-3.1.0}/pyproject.toml +0 -0
  56. {circup-3.0.3 → circup-3.1.0}/requirements.txt +0 -0
  57. {circup-3.0.3 → circup-3.1.0}/requirements.txt.license +0 -0
  58. {circup-3.0.3 → circup-3.1.0}/setup.cfg +0 -0
  59. {circup-3.0.3 → circup-3.1.0}/tests/__init__.py +0 -0
  60. {circup-3.0.3 → circup-3.1.0}/tests/bad_module/__init__.py +0 -0
  61. {circup-3.0.3 → circup-3.1.0}/tests/bad_module/my_module.py +0 -0
  62. {circup-3.0.3 → circup-3.1.0}/tests/bad_python.py +0 -0
  63. {circup-3.0.3 → circup-3.1.0}/tests/bundle.json +0 -0
  64. {circup-3.0.3 → circup-3.1.0}/tests/bundle.json.license +0 -0
  65. {circup-3.0.3 → circup-3.1.0}/tests/device.json +0 -0
  66. {circup-3.0.3 → circup-3.1.0}/tests/device.json.license +0 -0
  67. {circup-3.0.3 → circup-3.1.0}/tests/dir_module/__init__.py +0 -0
  68. {circup-3.0.3 → circup-3.1.0}/tests/dir_module/my_module.py +0 -0
  69. {circup-3.0.3 → circup-3.1.0}/tests/import_styles.py +0 -0
  70. {circup-3.0.3 → circup-3.1.0}/tests/local_module.py +0 -0
  71. {circup-3.0.3 → circup-3.1.0}/tests/local_module_cp7.mpy +0 -0
  72. {circup-3.0.3 → circup-3.1.0}/tests/local_module_cp7.mpy.license +0 -0
  73. {circup-3.0.3 → circup-3.1.0}/tests/mock_device/apps/test_app/import_styles.py +0 -0
  74. {circup-3.0.3 → circup-3.1.0}/tests/mock_device/apps/test_app/import_styles_sub.py +0 -0
  75. {circup-3.0.3 → circup-3.1.0}/tests/mock_device/boot_out.txt +0 -0
  76. {circup-3.0.3 → circup-3.1.0}/tests/mock_device/boot_out.txt.license +0 -0
  77. {circup-3.0.3 → circup-3.1.0}/tests/mock_device/import_styles.py +0 -0
  78. {circup-3.0.3 → circup-3.1.0}/tests/mock_device/import_styles_sub.py +0 -0
  79. {circup-3.0.3 → circup-3.1.0}/tests/mock_device/lib/adafruit_waveform/.gitkeep +0 -0
  80. {circup-3.0.3 → circup-3.1.0}/tests/mock_device_2/.gitignore +0 -0
  81. {circup-3.0.3 → circup-3.1.0}/tests/mock_device_2/boot_out.txt +0 -0
  82. {circup-3.0.3 → circup-3.1.0}/tests/mock_device_2/boot_out.txt.license +0 -0
  83. {circup-3.0.3 → circup-3.1.0}/tests/mock_device_2/code.py +0 -0
  84. {circup-3.0.3 → circup-3.1.0}/tests/mock_device_2/import_styles_sub.py +0 -0
  85. {circup-3.0.3 → circup-3.1.0}/tests/mock_device_2/package/__init__.py +0 -0
  86. {circup-3.0.3 → circup-3.1.0}/tests/mock_device_2/package/other.py +0 -0
  87. {circup-3.0.3 → circup-3.1.0}/tests/mount_exists.txt +0 -0
  88. {circup-3.0.3 → circup-3.1.0}/tests/mount_exists.txt.license +0 -0
  89. {circup-3.0.3 → circup-3.1.0}/tests/mount_missing.txt +0 -0
  90. {circup-3.0.3 → circup-3.1.0}/tests/mount_missing.txt.license +0 -0
  91. {circup-3.0.3 → circup-3.1.0}/tests/remote_module.py +0 -0
  92. {circup-3.0.3 → circup-3.1.0}/tests/test_bundle_config.json +0 -0
  93. {circup-3.0.3 → circup-3.1.0}/tests/test_bundle_config.json.license +0 -0
  94. {circup-3.0.3 → circup-3.1.0}/tests/test_bundle_config_local.json +0 -0
  95. {circup-3.0.3 → circup-3.1.0}/tests/test_bundle_config_local.json.license +0 -0
  96. {circup-3.0.3 → circup-3.1.0}/tests/test_module.mpy +0 -0
  97. {circup-3.0.3 → circup-3.1.0}/tests/test_module.mpy.license +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: circup
3
- Version: 3.0.3
3
+ Version: 3.1.0
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
@@ -812,6 +812,25 @@ class WebBackend(Backend):
812
812
  ) as r:
813
813
  return r.json()["files"]
814
814
 
815
+ def move_file(self, target_file, destination):
816
+ """
817
+ Rename or move a file or directory to the specified destination.
818
+ """
819
+ if not target_file:
820
+ raise ValueError("Target file cannot be empty.")
821
+ if not destination:
822
+ raise ValueError("Destination path cannot be empty.")
823
+ auth = HTTPBasicAuth("", self.password)
824
+ with self.session.request(
825
+ "MOVE",
826
+ urljoin(self.device_location, f"fs/{target_file}"),
827
+ auth=auth,
828
+ headers={"X-Destination": f"/fs/{destination}"},
829
+ timeout=self.timeout,
830
+ ) as r:
831
+ click.echo("move complete")
832
+ r.raise_for_status()
833
+
815
834
 
816
835
  class DiskBackend(Backend):
817
836
  """
@@ -390,7 +390,11 @@ def list_cli(ctx): # pragma: no cover
390
390
  "--auto", "-a", is_flag=True, help="Install the modules imported in code.py."
391
391
  )
392
392
  @click.option(
393
- "--upgrade", "-U", is_flag=True, help="Upgrade modules that are already installed."
393
+ "--upgrade",
394
+ "--update",
395
+ "-U",
396
+ is_flag=True,
397
+ help="Upgrade modules that are already installed.",
394
398
  )
395
399
  @click.option(
396
400
  "--stubs",
@@ -22,10 +22,16 @@ BAD_FILE_FORMAT = "Invalid"
22
22
  DATA_DIR = appdirs.user_data_dir(appname="circup", appauthor="adafruit")
23
23
 
24
24
  #: Module formats list (and the other form used in github files)
25
- PLATFORMS = {"py": "py", "8mpy": "8.x-mpy", "9mpy": "9.x-mpy", "10mpy": "10.x-mpy"}
25
+ PLATFORMS = {
26
+ "py": "py",
27
+ "8mpy": "8.x-mpy",
28
+ "9mpy": "9.x-mpy",
29
+ "10mpy": "10.x-mpy",
30
+ "11mpy": "11.x-mpy",
31
+ }
26
32
 
27
33
  #: CircuitPython platforms that are currently supported.
28
- SUPPORTED_PLATFORMS = ["9mpy", "10mpy"]
34
+ SUPPORTED_PLATFORMS = ["9mpy", "10mpy", "11mpy"]
29
35
 
30
36
  #: Timeout for requests calls like get()
31
37
  REQUESTS_TIMEOUT = 30
@@ -134,7 +140,10 @@ def extract_metadata(path, logger):
134
140
  logger.info("%s", path)
135
141
  if path.endswith(".py"):
136
142
  result["mpy"] = False
137
- with open(path, encoding="utf-8") as source_file:
143
+ # The dunder regex only reads ASCII, so replacing undecodable bytes is
144
+ # enough to keep a file saved in another encoding, ANSI/cp1252 on
145
+ # Windows for instance, from crashing metadata extraction.
146
+ with open(path, encoding="utf-8", errors="replace") as source_file:
138
147
  content = source_file.read()
139
148
  #: The regex used to extract ``__version__`` and ``__repo__`` assignments.
140
149
  dunder_key_val = r"""(__\w+__)(?:\s*:\s*\w+)?\s*=\s*(?:['"]|\(\s)(.+)['"]"""
@@ -77,6 +77,7 @@ To get help, just type the command::
77
77
  detection.
78
78
  --host TEXT Hostname or IP address of a device. Overrides automatic
79
79
  path detection.
80
+ --port INTEGER HTTP port that the web workflow is listening on.
80
81
  --password TEXT Password to use for authentication when --host is used.
81
82
  You can optionally set an environment variable
82
83
  CIRCUP_WEBWORKFLOW_PASSWORD instead of passing this
@@ -87,10 +88,12 @@ To get help, just type the command::
87
88
  --help Show this message and exit.
88
89
 
89
90
  Commands:
90
- get Download a copy of a file or directory from the device to the...
91
- ls Lists the contents of a directory.
92
- put Upload a copy of a file or directory from the local computer to...
93
- rm Delete a file on the device.
91
+ get Download a copy of a file or directory from the device to the...
92
+ ls Lists the contents of a directory.
93
+ mkdir Create a directory on the device with specified name.
94
+ mv Rename or move a file or directory on the device to the...
95
+ put Upload a copy of a file or directory from the local computer to...
96
+ rm Delete a file on the device.
94
97
 
95
98
 
96
99
  .. note::
@@ -223,9 +223,22 @@ def rm_cli(ctx, file): # pragma: no cover
223
223
  @click.pass_context
224
224
  def mkdir_cli(ctx, directory): # pragma: no cover
225
225
  """
226
- Create
226
+ Create a directory on the device with specified name.
227
227
  """
228
228
  click.echo(f"running: mkdir {directory}")
229
229
  ctx.obj["backend"].create_directory(
230
230
  ctx.obj["backend"].device_location, ctx.obj["backend"].get_file_path(directory)
231
231
  )
232
+
233
+
234
+ @main.command("mv")
235
+ @click.argument("file", required=True, nargs=1)
236
+ @click.argument("destination", required=True, nargs=1)
237
+ @click.pass_context
238
+ def mv_cli(ctx, file, destination): # pragma: no cover
239
+ """
240
+ Rename or move a file or directory on the device to the specified destination.
241
+ """
242
+
243
+ click.echo(f"running: mv {file} {destination}")
244
+ ctx.obj["backend"].move_file(file, destination)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: circup
3
- Version: 3.0.3
3
+ Version: 3.1.0
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
@@ -36,6 +36,8 @@ circup.egg-info/SOURCES.txt
36
36
  circup.egg-info/dependency_links.txt
37
37
  circup.egg-info/entry_points.txt
38
38
  circup.egg-info/requires.txt
39
+ circup.egg-info/scm_file_list.json
40
+ circup.egg-info/scm_version.json
39
41
  circup.egg-info/top_level.txt
40
42
  circup/config/bundle_config.json
41
43
  circup/config/bundle_config.json.license
@@ -0,0 +1,91 @@
1
+ {
2
+ "files": [
3
+ ".github/ISSUE_TEMPLATE.md",
4
+ ".github/PULL_REQUEST_TEMPLATE.md",
5
+ ".github/workflows/build.yml",
6
+ ".github/workflows/release.yml",
7
+ ".gitignore",
8
+ ".isort.cfg",
9
+ ".pre-commit-config.yaml",
10
+ ".pylintrc",
11
+ "CODE_OF_CONDUCT.rst",
12
+ "CODE_OF_CONDUCT.rst.license",
13
+ "CONTRIBUTING.rst",
14
+ "CONTRIBUTING.rst.license",
15
+ "LICENSE",
16
+ "LICENSES/CC-BY-4.0.txt",
17
+ "LICENSES/MIT.txt",
18
+ "LICENSES/Unlicense.txt",
19
+ "README.rst",
20
+ "README.rst.license",
21
+ "circup/__init__.py",
22
+ "circup/backends.py",
23
+ "circup/bundle.py",
24
+ "circup/command_utils.py",
25
+ "circup/commands.py",
26
+ "circup/config/bundle_config.json",
27
+ "circup/config/bundle_config.json.license",
28
+ "circup/lazy_metadata.py",
29
+ "circup/logging.py",
30
+ "circup/module.py",
31
+ "circup/shared.py",
32
+ "circup/wwshell/README.rst",
33
+ "circup/wwshell/README.rst.license",
34
+ "circup/wwshell/__init__.py",
35
+ "circup/wwshell/commands.py",
36
+ "docs/_static/favicon.ico",
37
+ "docs/_static/favicon.ico.license",
38
+ "docs/conf.py",
39
+ "docs/index.rst",
40
+ "docs/index.rst.license",
41
+ "docs/logo.png",
42
+ "docs/logo.png.license",
43
+ "docs/requirements.txt",
44
+ "optional_requirements.txt",
45
+ "optional_requirements.txt.license",
46
+ "pyproject.toml",
47
+ "readthedocs.yml",
48
+ "requirements.txt",
49
+ "requirements.txt.license",
50
+ "tests/__init__.py",
51
+ "tests/bad_module/__init__.py",
52
+ "tests/bad_module/my_module.py",
53
+ "tests/bad_python.py",
54
+ "tests/bundle.json",
55
+ "tests/bundle.json.license",
56
+ "tests/device.json",
57
+ "tests/device.json.license",
58
+ "tests/dir_module/__init__.py",
59
+ "tests/dir_module/my_module.py",
60
+ "tests/import_styles.py",
61
+ "tests/local_module.py",
62
+ "tests/local_module_cp7.mpy",
63
+ "tests/local_module_cp7.mpy.license",
64
+ "tests/mock_device/apps/test_app/import_styles.py",
65
+ "tests/mock_device/apps/test_app/import_styles_sub.py",
66
+ "tests/mock_device/boot_out.txt",
67
+ "tests/mock_device/boot_out.txt.license",
68
+ "tests/mock_device/import_styles.py",
69
+ "tests/mock_device/import_styles_sub.py",
70
+ "tests/mock_device/lib/adafruit_waveform/.gitkeep",
71
+ "tests/mock_device_2/.gitignore",
72
+ "tests/mock_device_2/boot_out.txt",
73
+ "tests/mock_device_2/boot_out.txt.license",
74
+ "tests/mock_device_2/code.py",
75
+ "tests/mock_device_2/import_styles_sub.py",
76
+ "tests/mock_device_2/package/__init__.py",
77
+ "tests/mock_device_2/package/other.py",
78
+ "tests/mount_exists.txt",
79
+ "tests/mount_exists.txt.license",
80
+ "tests/mount_missing.txt",
81
+ "tests/mount_missing.txt.license",
82
+ "tests/remote_module.py",
83
+ "tests/test_bundle_config.json",
84
+ "tests/test_bundle_config.json.license",
85
+ "tests/test_bundle_config_local.json",
86
+ "tests/test_bundle_config_local.json.license",
87
+ "tests/test_circup.py",
88
+ "tests/test_module.mpy",
89
+ "tests/test_module.mpy.license"
90
+ ]
91
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "3.1.0",
3
+ "distance": 0,
4
+ "node": "g31ecd83a0ab8103a712e087474a9361a504b6f7e",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-09-23"
8
+ }
@@ -19,5 +19,3 @@ python:
19
19
  install:
20
20
  - requirements: docs/requirements.txt
21
21
  - requirements: requirements.txt
22
-
23
- requirements_file: requirements.txt
@@ -680,7 +680,7 @@ def test_extract_metadata_python():
680
680
  "builtins.open", mock.mock_open(read_data=code)
681
681
  ) as mock_open, mock.patch("circup.logger.warning") as mock_logger:
682
682
  result = circup.extract_metadata(path, mock_logger)
683
- mock_open.assert_called_once_with(path, encoding="utf-8")
683
+ mock_open.assert_called_once_with(path, encoding="utf-8", errors="replace")
684
684
  assert len(result) == 3
685
685
  assert result["__version__"] == "1.1.4"
686
686
  assert result["__repo__"] == "https://github.com/adafruit/SomeLibrary.git"
@@ -688,6 +688,25 @@ def test_extract_metadata_python():
688
688
  assert "compatibility" not in result
689
689
 
690
690
 
691
+ def test_extract_metadata_python_not_utf8(tmp_path):
692
+ """
693
+ Ensure that metadata is extracted from a .py file that isn't valid UTF-8
694
+ (e.g. saved with ANSI/cp1252 encoding on Windows) instead of raising
695
+ UnicodeDecodeError.
696
+ """
697
+ path = tmp_path / "ansi_module.py"
698
+ path.write_bytes(
699
+ "# A comment with \u2018ANSI\u2019 quotes\n"
700
+ '__version__ = "1.1.4"\n'
701
+ '__repo__ = "https://github.com/adafruit/SomeLibrary.git"\n'.encode("cp1252")
702
+ )
703
+ result = circup.extract_metadata(str(path), logger)
704
+ assert len(result) == 3
705
+ assert result["__version__"] == "1.1.4"
706
+ assert result["__repo__"] == "https://github.com/adafruit/SomeLibrary.git"
707
+ assert result["mpy"] is False
708
+
709
+
691
710
  def test_extract_metadata_byte_code_v6():
692
711
  """
693
712
  Ensure the __version__ is correctly extracted from the bytecode ".mpy"
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