nRF24 / pyRF24

A python package that wraps the RF24, RF24Network, and RF24Mesh C++ libraries.
http://pyrf24.rtfd.io
GNU General Public License v2.0
24 stars 3 forks source link

dummy package #2

Closed 2bndy5 closed 4 years ago

2bndy5 commented 4 years ago

this sets up

Important

The release.yml workflow assumes this repo's settings have a "secret" key named pypi_token that contains the API token for the pypi account used to upload. According to pypi, this API token is prefixed with pypi- (inclusive to secret key).

About Authors metdata

I've taken the liberty of adding everyone (including email if publicly available on github) that contributed to the various pyRF24*.cpp files. Although, I can reduce this info to only nRF24 org maintainers or the pypi account's email. I don't think the emails are required for pypi, but they're there for transparency.

p.s. The docs aren't setup to be deployed (intentionally), but they do build correctly if you follow the readme instructions at the bottom.

TMRh20 commented 4 years ago

Please excuse my ignorance, but I'm a bit confused. First I guess, this all looks good, but how do I verify it works etc? Second is what do you need me to do to set this up properly? I assume you need me or Avamander to set up the API key etc? *edit: I might have added an api key correctly...

2bndy5 commented 4 years ago

I assume you need me or Avamander to set up the API key etc?

Yes. The API key is gotten from the pypi account's settings. The pyRF24 repo should have this key saved as "pypi_token" in the settings' "secret" section.

Sample screenshot: Screenshot_20201110-124629_Chrome.jpg

If you named the "secret" key something else, I can rename the secrets.pypi_token reference in release.yml to whatever name you picked.

Please excuse my ignorance

No worries. No need to rush.

how do I verify it works etc?

The doc's build instructions are in the README.rst (at the bottom). The package build instructions are incomplete because the repo (& my fork) doesn't contain the boost.python wrappers (yet). Sufficed to say that this PR builds an empty package using the simple python3 setup.py sdist cmd. I've been looking into how we can upload binary distributable "wheels" (pypi package term for a specifically named/structured zip archive), but it is rather complicated since we might need to build the wrappers for several different platforms/drivers and upload all of those "wheels" to pypi under the package pyrf24... I admit, the "wheels" stuff is confusing, but I'm still researching this. From what I've read so far, pip will install the correct "wheel" based on the installing platform's attributes.

p.s. Many of the walkthroughs I've seen use CMake, and there seems to be a python package (3rd party) called scikit that's meant to make this distribution process easier.

TMRh20 commented 4 years ago

Ok, thanks for the info, that should help According to https://pypi.org/help/#apitoken I assumed it should be named __TOKEN__ The password has the pypy- prefix

2bndy5 commented 4 years ago

ok I just tested the api token mechanism with my pypi account that now has 2FA enabled, and it worked fine.

Side note, I chose to generate a different api token for both repos I have setup to release to pypi (I made a lib for those circular trackpads found in Steam-HTC VR controllers & the Steam Controller gamepad 🤓 ). I imagine an API token for the entire pypi account (1 that's used for multiple repos) would work the same.

Ready to merge & release v0.0 when you are. Ping me if there are any problems.

p.s. should probably check the box on the github drafting release page that says "this is a pre-release" (located at the bottom). It will still upload to pypi. I tend to use the rc-# suffix on the version of a pre-release like v0.0.0rc-1, but that's a personal preference.

TMRh20 commented 4 years ago

Just some minor issues, not sure how far this should be set up, but figure I can complain now and fix later:

  1. With sphinx I had to run apt-get install instead of using pip: https://stackoverflow.com/questions/37757151/the-sphinx-build-command-was-not-found
  2. At the bottom of readme.rst, it should be changed from sphinx build... to sphinx-build -E -W . _build
  3. In readme.rst I had to change all the code-block statements to say "bash" .. code-block:: bash
2bndy5 commented 4 years ago

when you see "sphinx-build command not found" it usually means the python's script folder isn't in your PATH env var. This is not a default addition upon python installation/update ☚ī¸

Because I'm developing from Windows my PATH env var contains /mnt/c/Users/ytreh/AppData/Roaming/Python/Python38/Scripts when I checked it with echo $PATH (using WSL Ubuntu bash).

The sphinx-quickstart cmd that I used to set it up generated a makefile and make.bat files, but I removed them thinking they were specific to my machine. I could restore them from my recycling bin, and see if that helps.

using bash syntax is cool because COLORS! No complaints there.

Either way, you're right the building docs instructions will need some attention.

EDIT: OOPS I didn't see the lack of hyphen in the readme. DOH! That's what I get for trying to go off of memory and not proofreading enough.

2bndy5 commented 4 years ago

I take that back. The generated Makefile works but it allows errors to get rendered into the docs 👎 I can't get the ./make html -W to work. I guess its worth just adding a paragraph about the "sphinx-build command not found" in the readme.