Skip to content

Commit bfd33d5

Browse files
Josverldpgeorge
authored andcommitted
CONTRIBUTING: Add guidelines for module documentation and versioning.
Signed-off-by: Jos Verlinde <[email protected]>
1 parent 2992784 commit bfd33d5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,40 @@ 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
98+
not be included in the cross-compiled bytecode and will not impact the size of
99+
the module when installed via `mip`.
100+
101+
When writing docstrings, please follow these guidelines:
102+
* Use triple double quotes (`"""`) for docstrings.
103+
* Multi-line docstrings should place the starting and ending triple quotes on
104+
their own lines.
105+
* Start with a brief summary of the module's purpose.
106+
* Include usage examples where appropriate (indent examplecode blocks with 4
107+
spaces).
108+
* Use proper indentation for multi-line docstrings to align with the code block.
109+
110+
### Module versioning
111+
112+
Each package in micropython-lib should include a `manifest.py` file that
113+
specifies metadata about the package, including its version. The version
114+
management is intentionally manual to ensure package stability and prevent
115+
accidental version bumps. When making changes to a package that affect its
116+
functionality or API, please update the version in `manifest.py`. The
117+
`tools/build.py` script will detect new versions and add them to the index, but
118+
won't increment versions automatically
119+
120+
> [!NOTE]
121+
> Changes to docstrings or comments that do not change the generated bytecode
122+
> should not change the version.
123+
90124
### Publishing packages from forks
91125

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

0 commit comments

Comments
 (0)