Commit graph

78 commits

Author SHA1 Message Date
foamyguy
18a4687739 use 9.x in all test mock devices. Fix package subimport logic. Fix tests. Update from_auto_files_local test to mimic Fruit Jam OS usage. 2025-08-14 10:21:11 -05:00
foamyguy
ab32fc2b5b fix subimport finding for auto-files that are not in the root. 2025-08-14 09:25:45 -05:00
foamyguy
fa59c1ecf9 remove findimports req, remove comment from test_circup 2025-03-31 09:41:15 -05:00
Neradoc
cde0dea1e5 sort results from get_all_imports() just for fun
modify mock_device_2 and add a new package module to test relative .imports
2025-02-16 18:04:01 +01:00
Neradoc
e7c7fb6d65 fix tests finding all in imports_from_code 2025-02-16 18:04:01 +01:00
Neradoc
d27ae8164c Make auto-install find user code recursively. Find code.py alternatives.
Auto install:
- Move finding libraries from auto-file into command utils (libraries_from_auto_file)
- Find the first possible code.py alternative in order (like main.py)
- Replace libraries_from_code_py using the ast module instead of findimports
- Get all imports to find local python imports
- Find all dependencies from user code recursively
Update backends:
- Add get_file_content in Backends subclasses
- Remove no longer used get_auto_file_path()
- Add list_dir() to DiskBackend
Update tests
- Add non-bundle imports
- Add submodule import
- Add another mock device to test finding code.py
2025-02-16 18:04:01 +01:00
Neradoc
43b31da905 fix mock variable in test_get_bundles_dict 2025-02-16 18:04:01 +01:00
Dan Halbert
60c4107dbd update test to 9 2025-02-08 15:19:26 -05:00
foamyguy
9b450c8ba2 mock bad data instead of json.load side effect 2024-04-08 12:19:26 -05:00
foamyguy
a2548e52d5 change module for mock json error 2024-04-08 12:14:01 -05:00
foamyguy
70b9b49872 change module for mock logger 2024-04-08 12:03:27 -05:00
foamyguy
d30e02fb88 change module for mock json fail 2024-04-08 11:56:57 -05:00
foamyguy
d3515e9eed mock current_tag prop instead of json.load 2024-04-08 11:42:41 -05:00
foamyguy
cd9fb82552 add modulename to mock. remove duplicate 2024-04-08 09:27:56 -05:00
foamyguy
dc6b445855 format 2024-04-08 09:21:05 -05:00
foamyguy
aea9ce6704 isfile and isdir? 2024-04-08 09:18:52 -05:00
foamyguy
591a2e6eeb code format 2024-04-08 09:15:03 -05:00
foamyguy
6f5ad6e663 try fix for test_esnure_latest_bundle's 2024-04-08 09:10:08 -05:00
foamyguy
dc5f2e4eab try fix for test_get_bundle() 2024-04-08 09:05:10 -05:00
foamyguy
ba726e2047 add mocked lib folder for module update dir test 2024-04-08 08:40:53 -05:00
foamyguy
fe326c84a4 fixing more tests 2024-04-07 12:27:58 -05:00
foamyguy
eef8326519 fixing more tests 2024-04-07 10:56:35 -05:00
foamyguy
d88003b5c5 starting to fix tests 2024-04-07 10:32:23 -05:00
foamyguy
1d100e0e42 code format + pylint fixes 2024-04-06 12:14:09 -05:00
foamyguy
3cd60f12a9 fix directory_module test 2024-03-03 12:58:38 -06:00
foamyguy
88a5f9a2e0 code format 2024-02-26 15:54:23 -06:00
foamyguy
33a0528087 Merge branch 'main' into web_workflow
# Conflicts:
#	circup/__init__.py
#	tests/test_circup.py
2024-02-26 15:46:40 -06:00
Dan Halbert
db47b6f423 update tests 2024-02-13 16:29:31 -05:00
foamyguy
01cceec6bf remove prints 2023-12-18 10:48:32 -06:00
foamyguy
1f9bee3ffc black format b4 pylint. fix tests tests to passing 2023-12-18 10:43:34 -06:00
foamyguy
d3eda67ddb fix typo, change name to DiskBackend, remove wrapper _get_circuitpython_version 2023-11-29 07:21:44 -06:00
foamyguy
a5b40b46d3 fixing tests 2023-11-22 18:02:48 -06:00
foamyguy
5615279eb3 Merge branch 'main' into web_workflow
# Conflicts:
#	circup/__init__.py
2023-11-13 11:01:08 -06:00
foamyguy
8987505241 implementing --auto for webworkflow 2023-11-10 17:51:40 -06:00
Dan Halbert
02d3aa7f7a add 9.x-support; don't give up if download fails 2023-10-29 00:04:43 -04:00
foamyguy
ae5cc2a9b4 Merge branch 'main' into web_workflow
# Conflicts:
#	circup/__init__.py
2023-10-28 11:34:03 -05:00
Dan Halbert
fbf5aa4d50 7.x bundles are no longer built 2023-10-04 15:09:35 -04:00
Neradoc
0306fae90c auto install improvements 2023-03-21 01:27:31 +01:00
Vladimir Kotal
8b413ffe16 add support for web workflow
fixes #156
2023-02-22 20:41:46 +01:00
Neradoc
d9c3c567e9 update to pylint 2.15.5 to avoid an error in pip installing it 2023-02-08 05:58:23 +01:00
Dan Halbert
4eea33612a
determine _bundle_count dynamically 2022-06-08 08:48:59 -04:00
foamyguy
c013e555ea bundle count in test 2022-06-06 12:42:57 -05:00
foamyguy
cf7e9b1557 fix tests for no 6.x bundle 2021-12-14 17:13:58 -06:00
Neradoc
05514e5d79
Add commands for a local list of 3rd party bundles (#128)
* Add local bundle commands

- the local bundles take precedence over the built-in ones
- bundle-show lists the bundles
  --modules lists the modules in each bundle
- bundle-add adds a bundle from the user/repo github string
  it does some level of checking that the repo's and zips URLs exist
- bundle-remove removes a bundle from the local list

* allow overwritting the built-in modules manually

* remove show_bundles_info

* filter github URLs into github repo string

* avoid duplicates if adding built-ins as local, but allow it (to override priority order)

* put bundle-remove --reset back

* small change in bundle-show, local first

* message on built-in in bundle-remove
2021-09-13 18:27:18 -07:00
Patrick
d467d2545b
move bundle config to JSON format (#126)
* move bundle config to JSON format

* correct docstring, change print back to logging

* remove make reference from contributing

* change layout and install for config file
2021-09-08 16:07:21 -07:00
Neradoc
a9f9cf5e77
Display the URL to update Circuitpython (#124)
* Display the URL to update circuitpython

- Display the URL to circuitpython.org, using the board's ID if available.
- Fix a crash if boot_out.txt contains more than 1 ";" (if boot.py prints some).
- Display a clean error if `boot_out.txt` is missing (can easily happen with --path).

* change internal Bundle.url to the base URL of the bundle

* "install --requirement" allows any path and checks it exists with click.

* "show <match>" forces lower case matching (install already does).
2021-09-06 13:27:25 -07:00
Jeff Epler
5076a5dd4f Fix handling of various import styles, add test 2021-08-07 11:34:20 -05:00
Neradoc
f797cdd08e
add module names completion for install (#103)
* add module names completion for install

* sort completion suggestions

* add instructions in the readme

* switch to click 8

* update setup.py to click 8

* fix from rebase (missing bundle list)

* try not to update bundles for shell completion
2021-06-27 14:02:30 -07:00
Neradoc
820dc0a7be
handle MPY versions from CP 7.x (#109) 2021-06-27 11:35:17 -07:00
Neradoc
79b4948c9a
Support for community bundle and future bundles (#110)
* switch to a Bundle class, with a global bundles list

* Test for missing directories in ensure_latest_bundle

* docstrings fixes and doc update
2021-06-26 15:33:25 -07:00