Skip to main content

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.

Release files for baseplate 2.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for baseplate 2.7.1
File Size Uploaded
baseplate-2.7.1.tar.gz 142.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for baseplate 2.7.1
File Interpreter ABI Platform
baseplate-2.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 333.5 kB

Release files / baseplate-2.7.1.tar.gz

Download URL baseplate-2.7.1.tar.gz
Size 142.5 kB
Tags Source
SHA-256 checksum
How to use checksums
97356d73b684759c887a69302acbca93953a6be564585ee48927a59440673a1e
BLAKE2b-256 checksum
How to use checksums
39062cdd2ba6d82e9f5dd7f76a06e068c8b546c1cd04fe29acdd8d0a4d85edea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1025-azure

Release files / baseplate-2.7.1-py3-none-any.whl

Download URL baseplate-2.7.1-py3-none-any.whl
Size 191.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24a2bc8f8a862397c3b614273807f39ee8cd629ba163b9e93a339f3bbd9b9bb5
BLAKE2b-256 checksum
How to use checksums
4041209bbceb014e34b0d6fd9b7ecb4cb6d30fba2e4bc9616b8ce590118aefe4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1025-azure

Release history Release notifications | RSS feed

This release

2.7.1 This release

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.5.10

2 release files

2.5.9

2 release files

2.5.8

2 release files

2.5.7

2 release files

2.5.6

2 release files

2.5.5

2 release files

2.5.4

2 release files

2.5.3

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.13

2 release files

2.4.10

2 release files

2.4.9

2 release files

2.4.8

2 release files

2.4.7

2 release files

2.4.6

2 release files

2.4.5

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.5.5

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.30.6

2 release files

0.30.5

2 release files

0.30.4

2 release files

0.30.3

2 release files

0.30.1

2 release files

0.30.0

2 release files

0.29.0

1 release file

0.26.0

1 release file

0.25.0

1 release file

0.24.1

1 release file

0.24.0

1 release file

0.23.2

1 release file

0.23.1

1 release file

0.23.0

1 release file

0.22.0

1 release file

0.21.0

1 release file

0.20.0

1 release file

0.19.0

1 release file

0.18.0

1 release file

0.17.1

1 release file

0.17.0

1 release file

0.16.2

1 release file

0.16.1

1 release file

0.16.0

1 release file

0.14.3

1 release file

0.14.2

1 release file

0.14.1

1 release file

0.14.0

1 release file

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page