web-push-libs / pywebpush

Python Webpush Data encryption library
Mozilla Public License 2.0
303 stars 52 forks source link

feat: Update for modern python #158

Closed jrconlin closed 3 months ago

jrconlin commented 6 months ago

This updates things to use more modern python practices. This includes:

BREAKING CHANGE Webpusher.encode will now return a NoData exception if no data is present to encode. Chances are you probably won't be impacted by this change since most push messages contain data, but one never knows. This alters the prior behavior where it would return None.

Includes fixes from #152 by https://github.com/TobeTek (Thanks!)

safwanrahman commented 6 months ago

Thanks @jrconlin, it is very nice to see this!

jrconlin commented 6 months ago

Well, still not quite sure I've got it right. Specifically, the project.scripts portion of pyproject.toml. I'd hope that creates the equivalent of python -m pywebpush but 🤷🏻‍♂️ ?

My python is a bit rusty as is, and I am WAY behind on modern packaging practices. Plus, a lot of the tutorials and docs are zero help. Any pointers and dope-slaps folk want to provide are more than welcome.