Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add package.json for MIP package manager#94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
wnienhaus merged 2 commits intomicropython:masterfromwnienhaus:mip_support
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletionREADME.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,8 +62,13 @@ To get going run the following directly on the ESP32:

.. code-block:: python

# Step 1: Install micropython-esp32-ulp
# IMPORTANT: Ensure the ESP32 is connected to a network with internet connectivity.

# Step 1: Install micropython-esp32-ulp (for MicroPython v1.20 or newer)
import mip
mip.install('github:micropython/micropython-esp32-ulp')

# Step 1: Install micropython-esp32-ulp (for MicroPython older than v1.20)
import upip
upip.install('micropython-esp32-ulp')

Expand Down
10 changes: 8 additions & 2 deletionsdocs/index.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,11 +13,17 @@ Overview
Installation
------------

On the ESP32, install using upip:
On the ESP32, install usingmip (orupip on older MicroPythons):

.. code-block:: python

# ensure the ESP32 is connected to a network with internet connectivity
# step 1: ensure the ESP32 is connected to a network with internet connectivity

# step 2 (for MicroPython 1.20 or newer)
import mip
mip.install('github:micropython/micropython-esp32-ulp')

# step 2 (for MicroPython older than 1.20)
import upip
upip.install('micropython-esp32-ulp')

Expand Down
19 changes: 19 additions & 0 deletionspackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
{
"v":1,
"urls":[
["esp32_ulp/__init__.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/__init__.py"],
["esp32_ulp/__main__.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/__main__.py"],
["esp32_ulp/assemble.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/assemble.py"],
["esp32_ulp/definesdb.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/definesdb.py"],
["esp32_ulp/link.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/link.py"],
["esp32_ulp/nocomment.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/nocomment.py"],
["esp32_ulp/opcodes.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/opcodes.py"],
["esp32_ulp/opcodes_s2.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/opcodes_s2.py"],
["esp32_ulp/parse_to_db.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/parse_to_db.py"],
["esp32_ulp/preprocess.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/preprocess.py"],
["esp32_ulp/soc.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/soc.py"],
["esp32_ulp/soc_s2.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/soc_s2.py"],
["esp32_ulp/soc_s3.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/soc_s3.py"],
["esp32_ulp/util.py", "github:micropython/micropython-esp32-ulp/esp32_ulp/util.py"]
]
}
50 changes: 50 additions & 0 deletionstools/genpkgjson.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
"""
Tool for generating package.json for the MIP package manager
Run this tool from the repo root, like:
python tools/genpkgjson.py > package.json
Note:
This tool works with both python3 and micropyton.
"""

importos
importjson

PACKAGE_JSON_VERSION=1

# Update the repo when working with a fork
GITHUB_REPO="micropython/micropython-esp32-ulp"


defget_files(path):
files= [f'{path}/{f}'forfinos.listdir(path)]
returnfiles


defbuild_urls(repo_base,files):
return [[f,f'github:{repo_base}/{f}']forfinfiles]


defprint_package_json(urls):
"""
Custom-formatting JSON output for better readability
json.dumps in MicroPython cannot format the output and python3
puts each element of each urls' sub-arrays onto a new line.
Here we print each file and its source url onto the same line.
"""
print('{')
print(f' "v":{PACKAGE_JSON_VERSION},')
print(' "urls":[')
print(',\n'.join([f'{json.dumps(u)}'foruinsorted(urls)]))
print(' ]')
print('}')


if__name__=='__main__':
library_root='esp32_ulp'
files=get_files(library_root)
urls=build_urls(GITHUB_REPO,files)
print_package_json(urls)

[8]ページ先頭

©2009-2025 Movatter.jp