Skip to content

Commit

Permalink
pypi_README.md: Add separate README for use in the pypi package
Browse files Browse the repository at this point in the history
Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
  • Loading branch information
oyvindronningstad committed Sep 27, 2024
1 parent 8fea144 commit 4bb5148
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
19 changes: 19 additions & 0 deletions pypi_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
zcbor
=====

After installing, zcbor can be invoked on the command line as `zcbor`, or included as a module via `import zcbor`.

This package has 2 uses:

1. Schema-based validation and conversion of YAML/JSON/CBOR data.
2. Generating C code that decodes/encodes and validates CBOR data according to a schema.

The schema language used by zcbor is [CDDL](https://datatracker.ietf.org/doc/rfc8610/) which allows creating very advanced and detailed schemas.

The PyPi package comes with a C library which is needed by the generated code.
This library is not run by the zcbor package, but in the user's project that includes zcbor-generated code.
If zcbor is asked to generate a cmake file, the file will reference the C library, and if asked to copy sources, zcbor will copy these library files to the given location.

The C library also functions as a standalone CBOR C library, and is used in the [Zephyr RTOS](https://zephyrproject.org/).

Please visit the [Github repository](https://github.com/NordicSemiconductor/zcbor) for more information about this Python package, and the C library.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'zcbor'
description = 'Code generation and validation using CDDL schemas'
readme = 'README.md'
description = 'Code generation and data validation using CDDL schemas'
readme = 'pypi_README.md'
license = {text = 'Apache'}
requires-python = ">=3.8"
classifiers = [
Expand Down
4 changes: 4 additions & 0 deletions tests/scripts/test_repo_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
p_root = Path(__file__).absolute().parents[2]
p_tests = p_root / 'tests'
p_readme = p_root / "README.md"
p_pypi_readme = p_root / "pypi_README.md"
p_architecture = p_root / "ARCHITECTURE.md"
p_release_notes = p_root / "RELEASE_NOTES.md"
p_init_py = p_root / '__init__.py'
Expand Down Expand Up @@ -207,6 +208,9 @@ def test_hello_world_readme(self):
def test_pet_readme(self):
self.do_test_links(p_pet_sample / "README.md")

def test_pypi_readme(self):
self.do_test_links(p_pypi_readme, allow_local=False)

@skipIf(list(map(version_int, python_version_tuple())) < [3, 10, 0],
"Skip on Python < 3.10 because of different wording in argparse output.")
@skipIf(platform.startswith("win"), "Skip on Windows because of path/newline issues.")
Expand Down

0 comments on commit 4bb5148

Please sign in to comment.