summaryrefslogtreecommitdiffstatshomepage
path: root/tools/manifestfile.py
Commit message (Collapse)AuthorAge
* tools/manifestfile.py: Fix freeze() when script is an empty iterable.Damien George2024-03-25
| | | | | | | | | | | | | | The documentation for `freeze()` says that: - If `script` is `None`, all files in `path` will be frozen. - If `script` is an iterable then `freeze()` is called on all items of the iterable. This commit makes sure this behaviour is followed when an empty tuple/list is passed in for `script` (previously an empty tuple/list froze all files). Fixes issue #14125. Signed-off-by: Damien George <damien@micropython.org>
* tools/manifestfile.py: Add --unix-ffi option.Angus Gratton2024-02-19
| | | | | | | | | | | | Follow up to 35dd959133fb233d75e9b3cddbf98b2ed01c6594, allows explicitly adding the unix-ffi library path from the command line. This option is needed when building unix-ffi manifests in micropython-lib CI. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
* tools/manifestfile.py: Change library search to use a list of paths.Damien George2024-02-08
| | | | | | | | | | | | | | | | | | | This commit changes how library packages are searched for when a manifest file is loaded: there is now simply a list of library paths that is searched in order for the given package. This list defaults to the main directories in micropython-lib, but can be added to -- either appended or prepended -- by using `add_library()`. In particular the way unix-ffi library packages are searched has changed, because the `unix_ffi` argument to `require()` is now removed. Instead, if a build wants to include packages from micropython-lib/unix-ffi, then it must explicitly add this to the list of paths to search using: add_library("unix-ffi", "$(MPY_LIB_DIR)/unix-ffi") Work done in collaboration with Jim Mussared. Signed-off-by: Damien George <damien@micropython.org>
* tools/manifestfile.py: Add support for external libraries.Jim Mussared2023-12-21
| | | | | | | | | | | | | | This adds a `add_library(name, path)` method for use in manifest.py that allows registering an external path (e.g. to another repo) by name. This name can then be passed to `require("package", library="name")` to reference packages in that repo/library rather than micropython-lib. Within the external library, `require()` continues to work as normal (referencing micropython-lib) by default, but they can also specify the library name to require another package from that repo/library. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* docs,tools: Change remaining "urequests" references to "requests".Damien George2023-10-05
| | | | Signed-off-by: Damien George <damien@micropython.org>
* tools/manifestfile.py: Fix license capturing.Jim Mussared2023-05-19
| | | | | | The license field was incorrectly being set to the version. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/manifestfile.py: Add support for publishing packages to PyPI.Jim Mussared2023-04-07
| | | | | | | | | | | | | | | | | | | | | | This adds a new MODE_PYPROJECT, which gives basic support to allow packaging a small subset of micropython-lib packages to PyPI. This change allows a package in micropython-lib to: - Add a "pypi" name to its metadata indicating that it's based on a PyPI package. - Add "stdlib" to its metadata indicating that it's a micropython version of a stdlib package. - Add a "pypi_publish" name to its metadata to indicate that it can be published to PyPI (this can be different to the package name, e.g. "foo" might want to be published as "micropython-foo"). When a package requires() another one, if it's in MODE_PYPROJECT then if the package is from pypi then it will record that as a pypi dependency instead (or no dependency at all if it's from stdlib). Also allows require() to explicitly specify the pypi name. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/manifestfile.py: Replace recursive glob with os.walk.Jim Mussared2022-09-30
| | | | | | Recursive glob isn't supported before Python 3.5. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/manifestfile.py: Add `author` kwarg to metadata().Jim Mussared2022-09-29
| | | | | | This allows future micropython-lib packages to specify an author. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* unix/variants/coverage: Add test for manifest freeze_mpy().Jim Mussared2022-09-19
| | | | | | | | | | | | This uses the frozentest.mpy that is also used by ports/minimal. Also fixes two bugs that these new tests picked up: - File extension matching in manifestfile.py. - Handling of freeze_mpy results in makemanifest. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/manifestfile.py: Allow manifests to set metadata.Jim Mussared2022-09-05
| | | | | | | | | | | The metadata can be version, description, and license. After executing a manifest, the top-level metadata can be queried, and also each file output from the manifest will have the metadata of the containing manifest. Use the version metadata to "tag" files before freezing such that they have __version__ available.
* tools/manifestfile.py: Allow require() to specify unix packages.Jim Mussared2022-09-05
| | | | | | | | | | | | | | By default, don't include micropython-lib/unix-ffi in the search. If unix_ffi=True is passed to require(), then include unix-ffi and make it take precedence over the other locations (e.g. python-stdlib). This does two things: - Prevents non-unix builds from using unix-only packages. - Allows the unix build to optionally use a more full-featured (e.g. ffi) based package, even with the same name as one from e.g. stdlib. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/manifestfile.py: Allow include of directory path.Jim Mussared2022-09-05
| | | | | | | If an include path is a directory, then it implicitly grabs the manifest.py file inside that directory. This simplifies most manifest.py files. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/manifestfile.py: Add library for working with manifests.Jim Mussared2022-09-05
This splits the manifest file loading logic from makemanifest.py and updates makemanifest.py to use it. This will allow non-freezing uses of manifests, such as defining packages and dependencies in micropython-lib. Also adds additional methods to the manifest "API": - require() - to get a package from micropython-lib. - module() - to define a single-file module - package() - to define a multi-file package module() and package() should replace most uses of freeze() and can also be also used in non-freezing scenarios. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>