-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update submodules & prepare for pypi distribution #11
Conversation
- preparing the release CI for publishing to pypi. - allow for manually triggering the workflows. - match pylint problems to diff using github annotations.
I've been test publishing the sdist on testPyPi: https://test.pypi.org/project/pyrf24/
The I've added a step in the build CI to automatically upload sdist from main branch to testPyPi. This way we can ensure the piwheels project should be able to build bdist_wheel from our published releases on the actual PyPi. |
pylint also checks src/pyrf24/*.py in CI. Whereas before, only the examples were linted.
@TMRh20 IIRC, the secret token used for PyPi is for your PyPi account. Now that I have admin access, I can change this to a token generated by my PyPi account. Alternatively, you can invite me as a collaborator for the pyrf24 project on PyPi (which will be created upon first publication). Beware, publishing a release will likely take about an hour to build the binary dists targeting the aarch64 platform. This may also allow us to cancel a release CI workflow run if we published hastily (but no guarantee). |
I think this would be the best option since you pretty much handle all the python stuff. |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some problems following the install instructions using pip, but python setup.py install -DRF24_DRIVER=SPIDEV
worked for me.
Can you clarify (steps to reproduce)? I'd like to have this polished enough for pypi. |
Please let me merge this myself, I'm self-reviewing the entire diff right now. |
Oh, I think the The skbuild-kit pkg doesn't like it when a previous build used makefiles and a new build attempt tries to use ninja (2 different build systems). Ninja is technically faster, but I don't think that parallel builds are enabled for ninja, so I doubt it is much faster than using the traditional makefiles build system. |
If I remove the build dependency in proroject.toml about requiring ninja, it should always use the first available build system it finds. The skbuild-kit pkg checks for ninja first, then tries using makefiles. The way it is now ninja is temporarily installed when using |
I also added a note to the README instructions about consecutive builds using |
I just cloned the update-submodules branch and ran |
Installing ninja via pip seems to require building from source. But installing ninja via apt is much more reliable (uses a pre-built pkg). The piwheels project uses ninja installed from apt (probably to expedite builds that can use ninja).
I started using Either way, I only had ninja as build req because I wasn't too confident about the process (was following the skbuild-kit docs recommendation). I'm more confident now, and I think these changes remove a lot of building hassles (aside from the time it takes to compile). ps - I prefer using makefiles because it has colors in CMake's output 🌈 Ironically, I don't like the pure makefile syntax (actually prefer bash script), but cmake abstracts that away for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to merge this. I can't think of anything else that I can test.
After merging I'll tag the main with v0.2.0, and start verifying pypi/testpypi index behaves as expected.
It worked! Sometimes I impress myself... After almost 2 hours of building bdist_wheels for aarch64 (using qemu emulation), v0.2.0 is live and well on pypi. Luckily, the piwheels project has already built the wheels for 32bit RPi OS. I tested the new release:
This is incredible! 🥇 I'm ready to officially deprecate the individual wrappers now... |
This is pretty cool, installation is so easy! Great work @2bndy5 |
This updates the submodules to their latest releases:
Other changes
isFifo()
exists in the RF24 C++ source, I've modified the pyRF24.cpp wrapper to use that instead of rolling its own. Both camel-cased and snake-cased forms of this function are exposed.tx_delay
property because I noticed it was missing when reviewing the docs. The original camel-casedtxDelay
is also exposed.Distributing to pypi
The release CI will now build and publish to pypi.org the following distributions upon publishing releases:
I think we can rely on the piwheels project to build
armv7l
(orarmv6l
) bdist_wheels as they claim to crawl pypi releases and upload their own bdist_wheels to their own piwheels index (which every RPi OS is configured to check when installing with pip - in addition to pypi's index). If I'm right, then this would save us the resources of having a dedicated RPi acting as a self-hosted CI runner just to build bdist_wheels for armv7l. More info about the piwheels project.