Package: setup2upypackage
MicroPython Package ValidationValidate and create MicroPython package JSON fileGeneralMicroPython Package Validation for mip package.json files📚 The latest documentation is available atMicroPython Package Validation ReadTheDocs📚InstallationInstall required toolsInstallationUsageValidateValidate package JSON fileValidate package JSON file from changelogOptionsCreateCreate package JSON fileCreate specific package JSON fileCreate package JSON file from changelogContributingUnittestsPrecommit hooksCreditsInstallationInstall required toolsPython3 must be installed on your system. Check the current Python version
with the following commandpython--version
python3--versionDepending on which commandPython 3.x.y(with x.y as some numbers) is
returned, use that command to proceed.python3-mvenv.venvsource.venv/bin/activate

pipinstall-rrequirements.txtInstallationpipinstallsetup2upypackageUsageValidateValidate package JSON fileThe following command will exit with a non-zero code in case of a difference
between the generated (based onsetup.py) and existing package
(package.json) content.upy-package\--setup_filetests/data/setup.py\--package_changelog_filetests/data/sample_changelog.md\--package_filetests/data/package.json\--validateValidate package JSON file from changelogIn case the package version is defined by a changelog and theversionentry
of thesetup.pyfile 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_filetests/data/setup.py\--package_changelog_filetests/data/sample_changelog.md\--package_filetests/data/package.json\--validateOptionsTo not take the version or the dependencies specified in thepackage.jsonfile during a validation run, use the--ignore-versionor--ignore-depsargument. Additionally addedboot.pyandmain.pyfiles inpackage.jsoncan be ignored using--ignore-boot-mainduring a validation run.CreateCreate package JSON fileThe following command creates apackage.jsonfile in the same directory as
the specifiedsetup.pyfile. The content of thepackage.jsonfile is
additionally printed to stdout (--print) with an indentation of 4 (due to
the--prettyoption)upy-package\--setup_filetests/data/setup.py\--create\--print\--prettyCreate specific package JSON fileA specific package JSON file can be specified with the--package_fileparameter. The file has to exist before running the command.upy-package\--setup_filetests/data/setup.py\--package_filetests/data/custom-package.json\--create\--print\--prettyCreate package JSON file from changelogIn case the package version is defined by a changelog and theversionentry
of thesetup.pyfile 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_filetests/data/setup.py\--package_changelog_filetests/data/sample_changelog.md\--create\--print\--prettyContributingUnittestsRun the unittests locally with the following command after installing this
package in a virtual environment# run all testsnose2--configtests/unittest.cfg# run only one specific testsnose2tests.test_setup2upypackage.TestSetup2uPyPackage.test_package_versionGenerate the coverage files withpythoncreate_report_dirs.py
coveragehtmlThe coverage report is placed atreports/coverage/html/index.htmlPrecommit hooksThis repo is equipped with a.pre-commit-hooks.yamlfile to be usable in
other repos.In order to run this repo's pre commit hooks, perform the following stepspipinstallpre-commit# for older systems without colored output support, last supported version is# 1.18.3 (7c3404ef1f7593094c854f99bcd3b3eec75fbb2f, 1.19.0 broke it)# test it with:# from os import openpty# r,w = openpty()pre-commitrun--all-filesCreditsBased on thePyPa sample project.