-
Notifications
You must be signed in to change notification settings - Fork 1k
top: Reorganise micropython-lib #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I should add one other note -- there are a few libraries in the python-stdlib directory that I'm not particularly interested in maintaining and would probably be keen move (archive) into the unix-ffi directory. These mostly fall into the category of "very unlikely to be used on a microcontroller". But first things first. |
It would be nice to see this repo actively developed again. I like the idea of having different categories/folders for code with different goals. |
I like the idea of getting rid of the stubs, I too don't feel they're particularly useful at all |
As far as upip is concerned, I'd recommend starting our own themed warehouse (https://github.com/pypa/warehouse) server that upip looks to preferentially, then people can submit packages to that directly with the same tools as pypi. This repo could then be set up with a ci build to automatically push any changes in the included packages directly to uPyPi |
This would be fantastic. I know Damien already has a custom 'PyPi' server in place but we should use warehouse so the community can help maintain the collection. |
That all sounds great @jimmo - and having you as a curator makes a lot of sense. A few extra notes:
But yes, reinvigorating micropython-lib is a fantastic idea! |
💯 |
I think this sounds great and a big thanks to @jimmo for volunteering to curate! I'm unclear about who would be responsible for maintaining the community submitted libraries? The member that submitted it? Or does it get "taken over" by the curator and MP folks? Also, this is going to sound pedantic, but as someone that has had their code "changed to be more like how someone else wants it to be" a few times now, that also has more libraries that could really be useful in this repo (WifiManager anyone?) the "you should not be using properties", "functions need to be formatted like this", "don't put spaces here or there", "text should be formatted like this", etc really puts me off wanting to contribute. I know this really doesn't have anything to do with this specific PR, but it kind of does as I think Jimmo jumped into this PR after we chatted yesterday while he was helping me with my WifiManager / asyncio issues. My WifiManager was suggested to be an ideal candidate for inclusion. One of the biggest issues with using MP right now is the lack of libraries, and that void will only get filled by community folks contributing, and if contributors are left to feel like their code "isn't good enough" or "doesn't match the repo rules" then we are going find folks might not want to contribute. Happy to be smacked over the head for this... but it is truly how I feel :) |
I should add that I am super excited that some (any) momentum might happen with regard to maintaining a good/large curated set of "official" libraries. |
This implements pretty much everything I mentioned in Slack so I'm very much +1 on the core principles :) The actual implementation is going to take some discussion probably.
You mean you want to be maintainer in the Github sense (accept PR/push into master) of this repository together with Damien?
@mattytrentini I'd actually consider splitting all roles into separate repositories (stdlib/micropython/unix-ffi). That also addresses concerns like 'It would be fantastic to have some way of clearly seeing which libraries implement standard library features' a bit better than just a sub directory. And it's also easier to tell to people: 'just go there for the std lib we have', without having to worry they get lost (as is the case now, in non-existing/non-conformant/not-working-on-your-port modules). Especially if the plan is to open up the micropython part for all sorts of user contributions, I think the stdlib should be kept separate.
There's a lot of them though. What would be the main benefits which make the extra maintainance worth it? Also that basically means each issue/PR has to go in it's own repository? For the micropython part of the library that could actually make sense though.
While I get that, you'll have to live with it. Consistency is key for projects with a lof of contributers. I've worked on projects where nearly every file looks different, not to speak of the formatting diffferences within each file. It's exhausting. It makes reading harder (that's actually a fact, these higher cognitive loads have been studied and published). It's annoying because if you want to add code you have to decide whether to use your standard style, the style of the surrounding lines or just pick something at random. And so on. And as far as formatting goes there's now tools/codeformat.py so it's easy to get right. |
@dpgeorge any thoughts on this? It would be good to move to move forward with micropython-lib as it's a major tool in getting more CPython compatibility. |
Providing the tools / scripts / docs to keep the code consistent would help a great deal here. I wouldn't mind my code being slightly rewritten to match conventions, as long as said conventions aren't constantly changing and adding heaps of git diff noise. |
I think we're basically on track for that: codeformat.py takes care of most of that both for C and Python code (it just needs to be used for this repository as well), and before it existed the code conventions were also followed rather well and not a lot has changed over the course of the years. Ok thare are some edge cases but unlike many other projects out there I feel like microPython does a very good job when it comes to consistency. |
I am new to micropython development. And as a new user, I can agree with the above discussion, the confusion is great. I checked this repository for the existence of some PR open for some time without completion, however, the esp32 manifest still includes modules from this repository: https://github.com/micropython/micropython/blob/master/ports/esp32/boards/manifest_release.py Anyway, is the contribution to this repository encouraged or is there another one that you can indicate? |
Thanks @jimmo for this proposal. I am fully supportive of it. (And sorry for taking forever to respond here.) I agree it makes sense to distinguish between conceptually different sets of libraries such as:
But even if there is such a separation into categories like this, it's still important that each module have a globally unique name so any two of them can coexist in the same system. I'd prefer to keep everything in the same repository, rather than split them up into separate repositories. I just think it's easier to manage that way. |
Just to be clear: you mean a distinction by means different directories, or something else? |
Yes by different top-level directories, rather than different repositories. I think different repositories makes it harder to manage issues, and more work for users to find the correct repository / search. |
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Superceded by uasyncio-v3 in the main repo. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Merged! Thanks @jimmo ! |
I'm late to this party and new to MicroPython as a whole, but I'm having trouble understanding where The link in the official MicroPython documentation is dead and other projects I've seen have simply grabbed their own copy of sdist_upip.py as a top level file from wherever they can find it -- is this the expectation now? |
It's been removed and replaced by |
One long-standing point of confusion around this repo is what it's actually for. The answer is that it's for making the Unix port be more like CPython, but that is not at all clear without really diving into the repo.
This PR aims to re-think this module instead as a common repository of useful modules, with the unix/ffi bits out of the spotlight. I'd eventually like to see this become a centralised place for MicroPython users (on all ports) to find drivers and useful libraries, and possibly as a staging ground for candidate libraries for freezing into some firmware build.
So this PR:
asyncio_slow
)unix-ffi
directory.micropython
andcpython-stdlib
directories.I'd like to volunteer as a sort of curator/maintainer role, especially with the goal of fostering library development for libraries that automate or simplify common tasks on MicroPython. Here's a random example off the top of my head: if I'd like to build a wifi-enabled widget, I'd love to come here and find a library for each of the tasks like captive portal, ap-setup-mode, save-credentials, etc. Similarly some high-level wrappers around common tasks with
ubluetooth
. Or pin debouncing, or drivers, etc.The big outstanding TODO is what to do about upip / pypi / etc. Before I tackle that I'd like to see what people think of this approach.
The other option is to just deprecate this repo (i.e. re-revert the "this repo is unmaintained" commit) -- let libraries be developed and distributed independently and perhaps consider only bringing really core useful libraries into the main micropython repo. I'd prefer to see a centralised repo, I think that's good for the community and good for discoverability.