Best practices libraries, documenting, version info #11838
Replies: 3 comments 1 reply
-
Obligatory disclaimer: I have written exactly one MicroPython library. I do not consider myself an expert by any means. Here's what I did:
I think I tend to go heavy on documentation, but it comes from my experience (frustration?) over the years of trying to figure out other free/open source code that's either sparsely documented or has documentation that doesn't explain what someone new to the project needs to know to get started. If you're keeping code in your own repo, I think you can do just about whatever you want, but I would definitely recommend using package.json so other folks can easily install your library. |
Beta Was this translation helpful? Give feedback.
-
@mishal I'm the maintainer of micropython-lib, but I inherited the original structure and versioning from a previous contributor. I don't know what their system was (if any). I've been gradually working away at trying to improve the quality and usefulness of micropython-lib, and in particular trying to adopt a more consistent approach to versioning. One thing I wish I had done was completely reset all version numbers to 1.0.0 when we introduced With regard to e.g. for the (I have just raised micropython/micropython-lib#690 to fix this for json/datetime). To answer some other specific points:
|
Beta Was this translation helpful? Give feedback.
-
Thank you for your answers.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello community,
firstly, I would like to thank all the people behing micropython for their hard work. I'm really excited what can be done using micropython!
To my questions:
Does micropython have some guides/advices/standards about documenting and versioning libraries and drivers? I'm working on my (first hw) project and I see different authors use different methods.
I would like to document my project including vendor libraries which I use, but i'm struggling with a kind of inconsistency. I'm used to document python using standard docstrings with reStructuredText format and generate them using sphinx.
Authors document the lib/driver outside the code (in readmes and tutorials) or document it using comments
Is there any reason for this? file size?
What about the library versions?
In the standard library the version is written only in the manifest.py file. Some libraries defines the version as two digits (0.1), some uses three (0.6.0), others different (3.4.2-4). Does this follow semantic versioning? Can I use the libraries with
0
as major version? Is there any changelog or I have to dig in the git log?Some libraries define the
__version__
attribute in the package so it can be loaded in runtime.I've found this page https://docs.micropython.org/en/latest/reference/packages.html#writing-publishing-packages which describes how to install packages but does not give any advice how to write them.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions