You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,6 +87,33 @@ specific conventions and guidelines for micropython-lib:
87
87
packages](README.md#installing-packages-from-forks) in your Pull Request
88
88
description.
89
89
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
+
90
117
### Publishing packages from forks
91
118
92
119
You can easily publish the packages from your micropython-lib
0 commit comments