Skip to main content

app-merge component for pop-evbus

Project description

Made with pop, a Python implementation of Plugin Oriented Programming Made with Python

This project contains app-merge components for pop-evbus .

Getting Started

Prerequisites

  • Python 3.8+

  • git (if installing from source, or contributing to the project)

Installation

If wanting to use evbus-pika, you can do so by either installing from PyPI or from source.

Install from PyPI

pip install evbus-pika

Install from source

# clone repo
git clone git@gitlab.com:vmware/idem/evbus-pika.git
cd evbus-pika

# Setup venv
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Usage

Configure pop-evbus for your app.

Create a pika profile

pika:
  default:
    connection:
      host: localhost
      port: 5672
      login: guest
      password: guest
    routing_key:

Encrypt the credentials file and export the ACCT environment variables

$ pip install acct
$ export ACCT_KEY=$(acct encrypt credentials.yml)
$ export ACCT_FILE="$PWD/credentials.yml.fernet"

Now when you put a message on the evbus queue, it will be propagated to your configured pika implementation.

async def my_func(hub):
    await hub.evbus.broker.put(body={"message": "event content"}, profile="default")

Testing

The rabbitmq-server binary needs to be installed via your package manager. Start a local rabbitmq-server with the default parameters:

$ docker run -p 5672:5672 \
--env RABBITMQ_HOSTS=localhost \
--env RABBITMQ_PORT=5672 \
--env RABBITMQ_USER=guest \
--env RABBITMQ_PASS=guest \
--env RABBITMQ_PROTOCOL=amqp \
rabbitmq:management

Configure credentials for testing with a local rabbitmq server:

# credentials.yml
pika:
  test_development_evbus_pika:
    connection:
      host: localhost
      port: 5672
      login: guest
      password: guest
    routing_key:

Encrypt the credentials file and export the ACCT environment variables

$ pip install acct
$ export ACCT_KEY=$(acct encrypt credentials.yml)
$ export ACCT_FILE="$PWD/credentials.yml"

Install testing requirements

$ pip install -r requirements/test.in

Run the tests with pytest: .. code-block:: bash

$ pytest tests

Roadmap

Reference the open issues for a list of proposed features (and known issues).

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

evbus-pika-5.0.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

evbus_pika-5.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file evbus-pika-5.0.0.tar.gz.

File metadata

  • Download URL: evbus-pika-5.0.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.4 tqdm/4.65.0 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.17

File hashes

Hashes for evbus-pika-5.0.0.tar.gz
Algorithm Hash digest
SHA256 0c2ed3d8191d222feb75892b89e6f21671802c62da4df77653d2abb33a8f3d1e
MD5 f4fb928736cbbeda3f542e0b21b91edc
BLAKE2b-256 05f4dbbcff1faf2ccfeffa52b6e988d52110bd302f0d321dc629d34c06d5d188

See more details on using hashes here.

File details

Details for the file evbus_pika-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: evbus_pika-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.4 tqdm/4.65.0 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.17

File hashes

Hashes for evbus_pika-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 088473c624b6143d3aff774ad8aeff6852dc10423ef3a6fa8690a8df7d1a198d
MD5 63a68f1bd11cb1a925448dc75c602ef8
BLAKE2b-256 87a4f63472443a1e574254dce1687c26667d710b1859a3106f77e8e2f5cd8bfd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page