{"id":15177314,"url":"https://github.com/brainelectronics/micropython-package-validation","last_synced_at":"2025-04-16T01:57:13.341Z","repository":{"id":148381359,"uuid":"619467556","full_name":"brainelectronics/micropython-package-validation","owner":"brainelectronics","description":"Validate and create MicroPython package JSON file","archived":false,"fork":false,"pushed_at":"2023-07-05T21:06:02.000Z","size":84,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T03:51:17.332Z","etag":null,"topics":["micropython","package","validation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brainelectronics.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-27T07:46:20.000Z","updated_at":"2025-02-24T15:15:51.000Z","dependencies_parsed_at":"2024-09-27T14:21:00.449Z","dependency_job_id":null,"html_url":"https://github.com/brainelectronics/micropython-package-validation","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":"0.030303030303030276","last_synced_commit":"0a30f34c60e1b09e74754526aaa092376f0626af"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":"brainelectronics/micropython-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainelectronics%2Fmicropython-package-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainelectronics%2Fmicropython-package-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainelectronics%2Fmicropython-package-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainelectronics%2Fmicropython-package-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brainelectronics","download_url":"https://codeload.github.com/brainelectronics/micropython-package-validation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023745,"owners_count":21199961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["micropython","package","validation"],"created_at":"2024-09-27T14:20:55.428Z","updated_at":"2025-04-16T01:57:13.303Z","avatar_url":"https://github.com/brainelectronics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MicroPython Package Validation\n\n[![Downloads](https://pepy.tech/badge/micropython-package-validation)](https://pepy.tech/project/micropython-package-validation)\n![Release](https://img.shields.io/github/v/release/brainelectronics/micropython-package-validation?include_prereleases\u0026color=success)\n![Python](https://img.shields.io/badge/python3-Ok-green.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/github/brainelectronics/micropython-package-validation/branch/main/graph/badge.svg)](https://app.codecov.io/github/brainelectronics/micropython-package-validation)\n[![CI](https://github.com/brainelectronics/micropython-package-validation/actions/workflows/release.yml/badge.svg)](https://github.com/brainelectronics/micropython-package-validation/actions/workflows/release.yml)\n\nValidate and create MicroPython package JSON file\n\n---------------\n\n## General\n\nMicroPython Package Validation for mip package.json files\n\n📚 The latest documentation is available at\n[MicroPython Package Validation ReadTheDocs][ref-rtd-micropython-package-validation] 📚\n\n\u003c!-- MarkdownTOC --\u003e\n\n- [Installation](#installation)\n    - [Install required tools](#install-required-tools)\n- [Installation](#installation-1)\n- [Usage](#usage)\n    - [Validate](#validate)\n        - [Validate package JSON file](#validate-package-json-file)\n        - [Validate package JSON file from changelog](#validate-package-json-file-from-changelog)\n        - [Options](#options)\n    - [Create](#create)\n        - [Create package JSON file](#create-package-json-file)\n            - [Create specific package JSON file](#create-specific-package-json-file)\n        - [Create package JSON file from changelog](#create-package-json-file-from-changelog)\n- [Contributing](#contributing)\n    - [Unittests](#unittests)\n    - [Precommit hooks](#precommit-hooks)\n- [Credits](#credits)\n\n\u003c!-- /MarkdownTOC --\u003e\n\n## Installation\n\n### Install required tools\n\nPython3 must be installed on your system. Check the current Python version\nwith the following command\n\n```bash\npython --version\npython3 --version\n```\n\nDepending on which command `Python 3.x.y` (with x.y as some numbers) is\nreturned, use that command to proceed.\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n\npip install -r requirements.txt\n```\n\n## Installation\n\n```bash\npip install setup2upypackage\n```\n\n## Usage\n\n### Validate\n#### Validate package JSON file\n\nThe following command will exit with a non-zero code in case of a difference\nbetween the generated (based on `setup.py`) and existing package\n(`package.json`) content.\n\n```bash\nupy-package \\\n    --setup_file tests/data/setup.py \\\n    --package_changelog_file tests/data/sample_changelog.md \\\n    --package_file tests/data/package.json \\\n    --validate\n```\n\n#### Validate package JSON file from changelog\n\nIn case the package version is defined by a changelog and the `version` entry\nof the `setup.py` file is filled on demand by e.g.\n[changelog2version][ref-changelog2version], the semantic version changelog can\nbe specified explicitly to use its latest entry for the version value.\n\n```bash\nupy-package \\\n    --setup_file tests/data/setup.py \\\n    --package_changelog_file tests/data/sample_changelog.md \\\n    --package_file tests/data/package.json \\\n    --validate\n```\n\n#### Options\n\nTo not take the version or the dependencies specified in the `package.json`\nfile during a validation run, use the `--ignore-version` or `--ignore-deps`\nargument. Additionally added `boot.py` and `main.py` files in `package.json`\ncan be ignored using `--ignore-boot-main` during a validation run.\n\n### Create\n#### Create package JSON file\n\nThe following command creates a `package.json` file in the same directory as\nthe specified `setup.py` file. The content of the `package.json` file is\nadditionally printed to stdout (`--print`) with an indentation of 4 (due to\nthe `--pretty` option)\n\n```bash\nupy-package \\\n    --setup_file tests/data/setup.py \\\n    --create \\\n    --print \\\n    --pretty\n```\n\n##### Create specific package JSON file\n\nA specific package JSON file can be specified with the `--package_file`\nparameter. The file has to exist before running the command.\n\n```bash\nupy-package \\\n    --setup_file tests/data/setup.py \\\n    --package_file tests/data/custom-package.json \\\n    --create \\\n    --print \\\n    --pretty\n```\n\n#### Create package JSON file from changelog\n\nIn case the package version is defined by a changelog and the `version` entry\nof the `setup.py` file is filled on demand by e.g.\n[changelog2version][ref-changelog2version], the semantic version changelog can\nbe specified explicitly to use its latest entry for the version value.\n\n```bash\nupy-package \\\n    --setup_file tests/data/setup.py \\\n    --package_changelog_file tests/data/sample_changelog.md \\\n    --create \\\n    --print \\\n    --pretty\n```\n\n## Contributing\n\n### Unittests\n\nRun the unittests locally with the following command after installing this\npackage in a virtual environment\n\n```bash\n# run all tests\nnose2 --config tests/unittest.cfg\n\n# run only one specific tests\nnose2 tests.test_setup2upypackage.TestSetup2uPyPackage.test_package_version\n```\n\nGenerate the coverage files with\n\n```bash\npython create_report_dirs.py\ncoverage html\n```\n\nThe coverage report is placed at `reports/coverage/html/index.html`\n\n### Precommit hooks\n\nThis repo is equipped with a `.pre-commit-hooks.yaml` file to be usable in\nother repos.\n\nIn order to run this repo's pre commit hooks, perform the following steps\n\n```bash\npip install pre-commit\n# for older systems without colored output support, last supported version is\n# 1.18.3 (7c3404ef1f7593094c854f99bcd3b3eec75fbb2f, 1.19.0 broke it)\n# test it with:\n# from os import openpty\n# r,w = openpty()\n\npre-commit run --all-files\n```\n\n## Credits\n\nBased on the [PyPa sample project][ref-pypa-sample].\n\n\u003c!-- Links --\u003e\n[ref-rtd-micropython-package-validation]: https://micropython-package-validation.readthedocs.io/en/latest/\n[ref-pypa-sample]: https://github.com/pypa/sampleproject\n[ref-changelog2version]: https://github.com/brainelectronics/changelog2version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainelectronics%2Fmicropython-package-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainelectronics%2Fmicropython-package-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainelectronics%2Fmicropython-package-validation/lists"}