Validate and create MicroPython package JSON file
Project description
MicroPython Package Validation
Validate and create MicroPython package JSON file
General
MicroPython Package Validation for mip package.json files
📚 The latest documentation is available at MicroPython Package Validation ReadTheDocs 📚
Installation
Install required tools
Python3 must be installed on your system. Check the current Python version with the following command
python --version
python3 --version
Depending on which command Python 3.x.y
(with x.y as some numbers) is
returned, use that command to proceed.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Installation
pip install setup2upypackage
Usage
Validate
Validate package JSON file
The following command will exit with a non-zero code in case of a difference
between the generated (based on setup.py
) and existing package
(package.json
) content.
upy-package \
--setup_file tests/data/setup.py \
--package_changelog_file tests/data/changelog.md \
--package_file tests/data/package.json \
--validate
Validate package JSON file from changelog
In case the package version is defined by a changelog and the version
entry
of the setup.py
file is filled on demand by e.g.
changelog2version, the semantic version changelog can
be specified explicitly to use its latest entry for the version value.
upy-package \
--setup_file tests/data/setup.py \
--package_changelog_file tests/data/sample_changelog.md \
--package_file tests/data/package.json \
--validate
Create
Create package JSON file
The following command creates a package.json
file in the same directory as
the specified setup.py
file. The content of the package.json
file is
additionally printed to stdout (--print
) with an indentation of 4 (due to
the --pretty
option)
upy-package \
--setup_file tests/data/setup.py \
--create \
--print \
--pretty
Create specific package JSON file
A specific package JSON file can be specified with the --package_file
parameter. The file has to exist before running the command.
upy-package \
--setup_file tests/data/setup.py \
--package_file tests/data/custom-package.json \
--create \
--print \
--pretty
Create package JSON file from changelog
In case the package version is defined by a changelog and the version
entry
of the setup.py
file is filled on demand by e.g.
changelog2version, the semantic version changelog can
be specified explicitly to use its latest entry for the version value.
upy-package \
--setup_file tests/data/setup.py \
--package_changelog_file tests/data/sample_changelog.md \
--create \
--print \
--pretty
Contributing
Unittests
Run the unittests locally with the following command after installing this package in a virtual environment
# run all tests
nose2 --config tests/unittest.cfg
# run only one specific tests
nose2 tests.test_setup2upypackage.TestSetup2uPyPackage.test_package_version
Generate the coverage files with
python create_report_dirs.py
coverage html
The coverage report is placed at reports/coverage/html/index.html
Credits
Based on the PyPa sample project.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file setup2upypackage-0.1.0.tar.gz
.
File metadata
- Download URL: setup2upypackage-0.1.0.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 543af32ad2d29f23705118483fb239232b5b71ac48a8e0ce25c57c8ac2214e2e |
|
MD5 | c6d209e1276a69c06e9567ccf934dbc3 |
|
BLAKE2b-256 | e47fe88a5b1ef676e049fbdb871b5be10e29d2aca4464c7bf61bb1cc88c77a1a |
File details
Details for the file setup2upypackage-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: setup2upypackage-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c0f07c38c75b6c993f304d4e90991fc2da6fa8db1776eeceaac512d88e6ecf4 |
|
MD5 | aaf2da2462f62236745555ba3d5cf275 |
|
BLAKE2b-256 | f7d18b01a29832c46cf028727700d6cc9137f2f087c5174b27447dcd40dd6165 |