Skip to main content

reddit's python service framework

Project description

baseplate.py

It's much easier to manage a bunch of services when they all have the same shape: the way they're developed, the way they interact with the infrastructure they run on, and the way they interact with each other. Baseplate is reddit's specification for the common shape of our services. This library, Baseplate.py, is the Python implementation of that specification.

Baseplate.py glues together tooling for interacting with the reddit backend ecosystem and spackles over things that are missing. It integrates with Apache Thrift, Pyramid, and client libraries for many systems to transparently make your applications observable.

Baseplate applications transparently get:

  • Timing and request rate metrics using statsd
  • Distributed tracing with Zipkin
  • Error reporting and aggregation with Sentry

And can take advantage of:

  • Integration with commonly used clients like: Thrift, SQLAlchemy, cassandra-driver, pymemcache, redis-py, and Kombu
  • Secrets securely pulled from Vault

And many other things!

pre-commit

This repo comes with pre-commit hooks that let you (on a voluntary basis) enable pre-commit and/or pre-push hooks.

Configuration can be found at the root of the directory in .pre-commit-config.yaml. On its own, the configuration file doesn't do anything. You either need to run the hooks manually or install them so that they run automatically on every commit or push.

Currently, we run the make fmt target on commit and make lint / pytest actions on push.

Specific hooks can be temporarily disabled.

You can install hooks only for a specific step (i.e. pre-push).

Testing in Snoodev

You can upgrade any service to use in development Baseplate code in Snoodev by editing the requirements file for the service you would like to use for testing. Update the the Baseplate requirement to pull from Github instead, like this:

diff --git a/requirements.txt b/requirements.txt
index aef8ad8..d32a078 100644
--- a/requirements.txt
+++ b/requirements.txt
-baseplate==2.5.7
+git+https://github.com/reddit/baseplate.py@<ref>#egg=baseplate

In this case the ref can be either a commit hash or a branch name. After making this update you can check if the service works in Snoodev.

Warning Never deploy this change to production. Production should always use a Baseplate semantic version that has been tagged, and released.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

baseplate-2.7.0b1.tar.gz (135.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

baseplate-2.7.0b1-py3-none-any.whl (182.3 kB view details)

Uploaded Python 3

File details

Details for the file baseplate-2.7.0b1.tar.gz.

File metadata

  • Download URL: baseplate-2.7.0b1.tar.gz
  • Upload date:
  • Size: 135.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1018-azure

File hashes

Hashes for baseplate-2.7.0b1.tar.gz
Algorithm Hash digest
SHA256 ef4300ce64d6f8771f0c5804461cbc6bc046c164131796ca286da6ce0f8de57b
MD5 1f4e7b03acf9b0bd0e0302c120d858bb
BLAKE2b-256 31a2035111ecb00fd979cbb2b204dc80d396668cb76bd3d5972a99787d40060e

See more details on using hashes here.

File details

Details for the file baseplate-2.7.0b1-py3-none-any.whl.

File metadata

  • Download URL: baseplate-2.7.0b1-py3-none-any.whl
  • Upload date:
  • Size: 182.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1018-azure

File hashes

Hashes for baseplate-2.7.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 9454a4df8cf915c6ec279a0bca0f9aaf188dd6faa22209077af17017e0996355
MD5 1b9a2b5c60c179df8459581fe9618e91
BLAKE2b-256 9f77d54f672f2e54e36fe5e5c4e644e3b672d6cf6c4b22cff9395a14572cd485

See more details on using hashes here.

Supported by

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