circup 2.2.3__tar.gz → 2.2.4__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.3/circup.egg-info → circup-2.2.4}/PKG-INFO +1 -1
  2. {circup-2.2.3 → circup-2.2.4}/circup/command_utils.py +12 -0
  3. {circup-2.2.3 → circup-2.2.4}/circup/commands.py +22 -0
  4. {circup-2.2.3 → circup-2.2.4/circup.egg-info}/PKG-INFO +1 -1
  5. {circup-2.2.3 → circup-2.2.4}/.github/ISSUE_TEMPLATE.md +0 -0
  6. {circup-2.2.3 → circup-2.2.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  7. {circup-2.2.3 → circup-2.2.4}/.github/workflows/build.yml +0 -0
  8. {circup-2.2.3 → circup-2.2.4}/.github/workflows/release.yml +0 -0
  9. {circup-2.2.3 → circup-2.2.4}/.gitignore +0 -0
  10. {circup-2.2.3 → circup-2.2.4}/.isort.cfg +0 -0
  11. {circup-2.2.3 → circup-2.2.4}/.pre-commit-config.yaml +0 -0
  12. {circup-2.2.3 → circup-2.2.4}/.pylintrc +0 -0
  13. {circup-2.2.3 → circup-2.2.4}/CODE_OF_CONDUCT.rst +0 -0
  14. {circup-2.2.3 → circup-2.2.4}/CODE_OF_CONDUCT.rst.license +0 -0
  15. {circup-2.2.3 → circup-2.2.4}/CONTRIBUTING.rst +0 -0
  16. {circup-2.2.3 → circup-2.2.4}/CONTRIBUTING.rst.license +0 -0
  17. {circup-2.2.3 → circup-2.2.4}/LICENSE +0 -0
  18. {circup-2.2.3 → circup-2.2.4}/LICENSES/CC-BY-4.0.txt +0 -0
  19. {circup-2.2.3 → circup-2.2.4}/LICENSES/MIT.txt +0 -0
  20. {circup-2.2.3 → circup-2.2.4}/LICENSES/Unlicense.txt +0 -0
  21. {circup-2.2.3 → circup-2.2.4}/README.rst +0 -0
  22. {circup-2.2.3 → circup-2.2.4}/README.rst.license +0 -0
  23. {circup-2.2.3 → circup-2.2.4}/circup/__init__.py +0 -0
  24. {circup-2.2.3 → circup-2.2.4}/circup/backends.py +0 -0
  25. {circup-2.2.3 → circup-2.2.4}/circup/bundle.py +0 -0
  26. {circup-2.2.3 → circup-2.2.4}/circup/config/bundle_config.json +0 -0
  27. {circup-2.2.3 → circup-2.2.4}/circup/config/bundle_config.json.license +0 -0
  28. {circup-2.2.3 → circup-2.2.4}/circup/logging.py +0 -0
  29. {circup-2.2.3 → circup-2.2.4}/circup/module.py +0 -0
  30. {circup-2.2.3 → circup-2.2.4}/circup/shared.py +0 -0
  31. {circup-2.2.3 → circup-2.2.4}/circup/wwshell/README.rst +0 -0
  32. {circup-2.2.3 → circup-2.2.4}/circup/wwshell/README.rst.license +0 -0
  33. {circup-2.2.3 → circup-2.2.4}/circup/wwshell/__init__.py +0 -0
  34. {circup-2.2.3 → circup-2.2.4}/circup/wwshell/commands.py +0 -0
  35. {circup-2.2.3 → circup-2.2.4}/circup.egg-info/SOURCES.txt +0 -0
  36. {circup-2.2.3 → circup-2.2.4}/circup.egg-info/dependency_links.txt +0 -0
  37. {circup-2.2.3 → circup-2.2.4}/circup.egg-info/entry_points.txt +0 -0
  38. {circup-2.2.3 → circup-2.2.4}/circup.egg-info/requires.txt +0 -0
  39. {circup-2.2.3 → circup-2.2.4}/circup.egg-info/top_level.txt +0 -0
  40. {circup-2.2.3 → circup-2.2.4}/docs/_static/favicon.ico +0 -0
  41. {circup-2.2.3 → circup-2.2.4}/docs/_static/favicon.ico.license +0 -0
  42. {circup-2.2.3 → circup-2.2.4}/docs/conf.py +0 -0
  43. {circup-2.2.3 → circup-2.2.4}/docs/index.rst +0 -0
  44. {circup-2.2.3 → circup-2.2.4}/docs/index.rst.license +0 -0
  45. {circup-2.2.3 → circup-2.2.4}/docs/logo.png +0 -0
  46. {circup-2.2.3 → circup-2.2.4}/docs/logo.png.license +0 -0
  47. {circup-2.2.3 → circup-2.2.4}/optional_requirements.txt +0 -0
  48. {circup-2.2.3 → circup-2.2.4}/optional_requirements.txt.license +0 -0
  49. {circup-2.2.3 → circup-2.2.4}/pyproject.toml +0 -0
  50. {circup-2.2.3 → circup-2.2.4}/readthedocs.yml +0 -0
  51. {circup-2.2.3 → circup-2.2.4}/requirements.txt +0 -0
  52. {circup-2.2.3 → circup-2.2.4}/requirements.txt.license +0 -0
  53. {circup-2.2.3 → circup-2.2.4}/setup.cfg +0 -0
  54. {circup-2.2.3 → circup-2.2.4}/tests/__init__.py +0 -0
  55. {circup-2.2.3 → circup-2.2.4}/tests/bad_module/__init__.py +0 -0
  56. {circup-2.2.3 → circup-2.2.4}/tests/bad_module/my_module.py +0 -0
  57. {circup-2.2.3 → circup-2.2.4}/tests/bad_python.py +0 -0
  58. {circup-2.2.3 → circup-2.2.4}/tests/bundle.json +0 -0
  59. {circup-2.2.3 → circup-2.2.4}/tests/bundle.json.license +0 -0
  60. {circup-2.2.3 → circup-2.2.4}/tests/device.json +0 -0
  61. {circup-2.2.3 → circup-2.2.4}/tests/device.json.license +0 -0
  62. {circup-2.2.3 → circup-2.2.4}/tests/dir_module/__init__.py +0 -0
  63. {circup-2.2.3 → circup-2.2.4}/tests/dir_module/my_module.py +0 -0
  64. {circup-2.2.3 → circup-2.2.4}/tests/import_styles.py +0 -0
  65. {circup-2.2.3 → circup-2.2.4}/tests/local_module.py +0 -0
  66. {circup-2.2.3 → circup-2.2.4}/tests/local_module_cp7.mpy +0 -0
  67. {circup-2.2.3 → circup-2.2.4}/tests/local_module_cp7.mpy.license +0 -0
  68. {circup-2.2.3 → circup-2.2.4}/tests/mock_device/apps/test_app/import_styles.py +0 -0
  69. {circup-2.2.3 → circup-2.2.4}/tests/mock_device/apps/test_app/import_styles_sub.py +0 -0
  70. {circup-2.2.3 → circup-2.2.4}/tests/mock_device/boot_out.txt +0 -0
  71. {circup-2.2.3 → circup-2.2.4}/tests/mock_device/boot_out.txt.license +0 -0
  72. {circup-2.2.3 → circup-2.2.4}/tests/mock_device/import_styles.py +0 -0
  73. {circup-2.2.3 → circup-2.2.4}/tests/mock_device/import_styles_sub.py +0 -0
  74. {circup-2.2.3 → circup-2.2.4}/tests/mock_device/lib/adafruit_waveform/.gitkeep +0 -0
  75. {circup-2.2.3 → circup-2.2.4}/tests/mock_device_2/.gitignore +0 -0
  76. {circup-2.2.3 → circup-2.2.4}/tests/mock_device_2/boot_out.txt +0 -0
  77. {circup-2.2.3 → circup-2.2.4}/tests/mock_device_2/boot_out.txt.license +0 -0
  78. {circup-2.2.3 → circup-2.2.4}/tests/mock_device_2/code.py +0 -0
  79. {circup-2.2.3 → circup-2.2.4}/tests/mock_device_2/import_styles_sub.py +0 -0
  80. {circup-2.2.3 → circup-2.2.4}/tests/mock_device_2/package/__init__.py +0 -0
  81. {circup-2.2.3 → circup-2.2.4}/tests/mock_device_2/package/other.py +0 -0
  82. {circup-2.2.3 → circup-2.2.4}/tests/mount_exists.txt +0 -0
  83. {circup-2.2.3 → circup-2.2.4}/tests/mount_exists.txt.license +0 -0
  84. {circup-2.2.3 → circup-2.2.4}/tests/mount_missing.txt +0 -0
  85. {circup-2.2.3 → circup-2.2.4}/tests/mount_missing.txt.license +0 -0
  86. {circup-2.2.3 → circup-2.2.4}/tests/remote_module.py +0 -0
  87. {circup-2.2.3 → circup-2.2.4}/tests/test_bundle_config.json +0 -0
  88. {circup-2.2.3 → circup-2.2.4}/tests/test_bundle_config.json.license +0 -0
  89. {circup-2.2.3 → circup-2.2.4}/tests/test_bundle_config_local.json +0 -0
  90. {circup-2.2.3 → circup-2.2.4}/tests/test_bundle_config_local.json.license +0 -0
  91. {circup-2.2.3 → circup-2.2.4}/tests/test_circup.py +0 -0
  92. {circup-2.2.3 → circup-2.2.4}/tests/test_module.mpy +0 -0
  93. {circup-2.2.3 → circup-2.2.4}/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.3
3
+ Version: 2.2.4
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
@@ -841,3 +841,15 @@ def sorted_by_directory_then_alpha(list_of_files):
841
841
  sorted_full_list.append(files[cur_name])
842
842
 
843
843
  return sorted_full_list
844
+
845
+
846
+ def is_virtual_env_active():
847
+ """
848
+ Check if a virtual environment is currently active.
849
+
850
+ We don't check the more commonly recommended way of checking if
851
+ sys.prefix != sys.base_prefix as this will always be true if running circup
852
+ from a pipx install. This way ensures the user manually activated a
853
+ virtual environment, regardless how circup is installed.
854
+ """
855
+ return "VIRTUAL_ENV" in os.environ
@@ -41,6 +41,7 @@ from circup.command_utils import (
41
41
  get_bundles_dict,
42
42
  completion_for_example,
43
43
  get_bundle_examples,
44
+ is_virtual_env_active,
44
45
  )
45
46
 
46
47
 
@@ -354,6 +355,7 @@ def install(
354
355
  device_modules = ctx.obj["backend"].get_device_versions()
355
356
  if to_install is not None:
356
357
  to_install = sorted(to_install)
358
+ is_global_install_ok = None
357
359
  click.echo(f"Ready to install: {to_install}\n")
358
360
  for library in to_install:
359
361
  ctx.obj["backend"].install_module(
@@ -366,6 +368,26 @@ def install(
366
368
  )
367
369
 
368
370
  if stubs:
371
+ # Check we are in a virtual environment
372
+ if not is_virtual_env_active():
373
+ if is_global_install_ok is None:
374
+ click.secho(
375
+ (
376
+ "No virtual environment detected.\n"
377
+ "It is recommended to run circup inside a virtual environment "
378
+ "when installing stubs. Without a virtual environment, the stubs "
379
+ "will be installed to the global python."
380
+ ),
381
+ fg="yellow",
382
+ )
383
+ is_global_install_ok = click.confirm(
384
+ click.style(
385
+ "Would you still like to install stubs (to the global python)?",
386
+ fg="yellow",
387
+ )
388
+ )
389
+ if not is_global_install_ok:
390
+ continue
369
391
  library_stubs = "adafruit-circuitpython-{}".format(
370
392
  library.replace("adafruit_", "")
371
393
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: circup
3
- Version: 2.2.3
3
+ Version: 2.2.4
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
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