Skip to content

Commit c48443d

Browse files
committed
Docs: Add guidelines for module documentation and versioning.
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
1 parent 0836dbd commit c48443d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,33 @@ specific conventions and guidelines for micropython-lib:
8787
packages](README.md#installing-packages-from-forks) in your Pull Request
8888
description.
8989

90+
## Module documentation
91+
92+
Each package in micropython-lib is encouraged to include documentation in
93+
the form of docstrings in the code itself. The top-level docstring in the main
94+
module or package should provide an overview of the package's functionality,
95+
usage examples, and any important notes or caveats.
96+
97+
Note that the docstrings should be concise and relevant, even though they will not be included in the cross-compiled bytecode and will not impact the size of the module when installed via `mip`.
98+
99+
When writing docstrings, please follow these guidelines:
100+
* Use triple double quotes (`"""`) for docstrings.
101+
* Multi-line docstrings should place the starting and ending triple quotes on their own lines.
102+
* Start with a brief summary of the module's purpose.
103+
* Include usage examples where appropriate.
104+
* indent examplecode blocks with 4 spaces
105+
* Use proper indentation for multi-line docstrings to align with the code block.
106+
107+
## Module versioning
108+
109+
Each package in micropython-lib should include a `manifest.py` file that specifies metadata about the package, including its version.
110+
The version management is intentionally manual to ensure package stability and prevent accidental version bumps.
111+
When making changes to a package that affect its functionality or API, please update the version in `manifest.py`.
112+
The `tools/build.py` will detect new versions and add them to the index, but won't increment versions automatically
113+
114+
> [!NOTE]
115+
> Changes to docstrings or comments that do not change the generated bytecode should not change the version.
116+
90117
### Publishing packages from forks
91118

92119
You can easily publish the packages from your micropython-lib

0 commit comments

Comments
 (0)