Package: happyly
DescriptionHappyly helps to abstract your business logic from messaging stuff,
so that your code is maintainable and ensures separation of concerns.
Actual actions your code perform are abstracted into universalHandlerswhich can be used with any serialization technology or messaging protocol without any change.Happyly can be used with Flask, Celery, Django, Kafka or whatever
technology which is utilized for messaging.
Happyly also provides first-class support of Google Pub/Sub.Why this name?Happyly stands forHAndlers forPub/sub as aPYthonLibrarYThe lib was originally created for usage with Google Pub/Sub,
but it then turned out that the idea is much more universal and can simplify
transition between messaging and serialization technologies.Installationpip install happylyFor additional components usepip install happyly[google-cloud-pubsub]orpip install happyly[flask]orpip install happyly[redis]DocumentationRead the docsDevelopmentCreate and activate a virtual environment (e.g.python -m venv env; source env/bin/activate).Installflit:pip install flit.Useflitto install the package with all development dependencies:flit install.
Repeat this whenever you want to account for new code changes
or dependencies.Note that the repository usespre-committo auto-check code for style and types.
Enable it for your cloned repo withpre-commit install.In order to run tests, use eitherpytest(tests against your current python version)
ortox(will try to test against all supported python versions).When you are ready to deploy the project,
usebumpversion:bumpversion patch(orminor, ormajor) and thengit push && git push --tags.Traviswill detect it
and automatically deploy the package to PyPI.
It is also advised to create a new release on GitHub
describing significant changes since the previous version.Important:at the time of writing, the packagebumpversionin PyPI is unmaintained
and has several issues. Please usebump2versioninstead.
It will automatically be installed withflit installas a developmment dependency,
so no need to install it manually.Note about versioning schemeWe use semantic versioning with addedrcstage:
each version (major, minor or patch) will start withrc1variant,
which is then advanced either torc2etc usingbumpversion rcor "released" usingbumpversion rel(which removedrcNsuffix completely).From thebumpversin's point of view, there are two additional version parts:rel(which can be eitheralpha,rcor missing =release)
andrcwhich denotes number of release candidate.alphais not used bybumpversiondirectly
but can be used when specifying version manually:bumpversion [major|minor|patch] --new-version 1.1.0alpha1.
If you usebumpversion relon such version, it will first transition fromalphaNtorc1,
and only then will it switch torelease, rejectingrcsuffix.If you want to release new version skippingrcstage (probably apatchversion)
then you can use either of these methods:bumpversion --new-version 1.0.1(substitute the desired new version) - not recommended;Recommended approach:bumpversion --no-tag patch && bumpversion rel.
This will create an intermediary commit forrcbut won't create a tag for it
and hence won't trigger deployment for intermediaryrc1version.LicenseThe code inside this repository is licensed underMIT License,
while images and documentation material are licensed underCreative Commons BY-NC-SA 4.0.