kopia lustrzana https://github.com/micropython/micropython
Merge c9d6cca0d0
into d11ca092f7
commit
5e6f771f28
|
@ -120,7 +120,12 @@ A typical ``package.json`` for an example ``mlx90640`` library looks like::
|
||||||
"deps": [
|
"deps": [
|
||||||
["collections-defaultdict", "latest"],
|
["collections-defaultdict", "latest"],
|
||||||
["os-path", "latest"],
|
["os-path", "latest"],
|
||||||
["github:org/micropython-additions", "main"]
|
["github:org/micropython-additions", "main"],
|
||||||
|
[
|
||||||
|
"folder/file.py",
|
||||||
|
"github:other_org/repo/src/some_file.py",
|
||||||
|
"1.7.4"
|
||||||
|
]
|
||||||
],
|
],
|
||||||
"version": "0.2"
|
"version": "0.2"
|
||||||
}
|
}
|
||||||
|
@ -130,7 +135,10 @@ This includes two files, hosted at a GitHub repo named
|
||||||
the device. It depends on ``collections-defaultdict`` and ``os-path`` which will
|
the device. It depends on ``collections-defaultdict`` and ``os-path`` which will
|
||||||
be installed automatically from the :term:`micropython-lib`. The third
|
be installed automatically from the :term:`micropython-lib`. The third
|
||||||
dependency installs the content as defined by the ``package.json`` file of the
|
dependency installs the content as defined by the ``package.json`` file of the
|
||||||
``main`` branch of the GitHub repo ``org/micropython-additions``.
|
``main`` branch of the GitHub repo ``org/micropython-additions``. The last
|
||||||
|
dependency installs the single file ``some_file.py`` of the GitHub repo
|
||||||
|
``other_org/repo`` located in the subfolder ``src`` as ``folder/file.py`` based on
|
||||||
|
the ``1.7.4`` tag.
|
||||||
|
|
||||||
Freezing packages
|
Freezing packages
|
||||||
-----------------
|
-----------------
|
||||||
|
|
|
@ -107,7 +107,11 @@ def _install_json(transport, package_json_url, index, target, version, mpy):
|
||||||
for target_path, url in package_json.get("urls", ()):
|
for target_path, url in package_json.get("urls", ()):
|
||||||
fs_target_path = target + "/" + target_path
|
fs_target_path = target + "/" + target_path
|
||||||
_download_file(transport, _rewrite_url(url, version), fs_target_path)
|
_download_file(transport, _rewrite_url(url, version), fs_target_path)
|
||||||
for dep, dep_version in package_json.get("deps", ()):
|
for sublist in package_json.get("deps", ()):
|
||||||
|
if len(sublist) == 2:
|
||||||
|
dep, dep_version = sublist[0], sublist[1]
|
||||||
|
else:
|
||||||
|
target, dep, dep_version = sublist[0], sublist[1], sublist[2]
|
||||||
_install_package(transport, dep, index, target, dep_version, mpy)
|
_install_package(transport, dep, index, target, dep_version, mpy)
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue