Skip to main content

Add your description here

Project description

Smallsteps - improve your codebase in small steps

Smallsteps allows you to declare ratchets – metrics that must increase over time – and to enforce them via testing or CI pipelines.

A typical situation: you want to add test coverage as a health check. Initially your coverage is at 42% so you create a CI gate that fails if it falls under 40%. Now you have your baseline secured – so far so good. You make a resolution to yourself that you will increase your coverage to bump up the percentage in your CI action frequently. Somehow that never happens and your coverage stays at 42%.

With smallsteps you declare your goal of 80% coverage and that you want to reach it in 100 days. Smallsteps computes the necessary percentage that must be met for each day (e.g. after 50 days you need 60% coverage) and fails if the goal is not met.

Example

We are using this repository itself as an example. We want to enforce our test coverage to go up. So we create a ratchet:

uvx smallsteps add \
  --name="Pytest Coverage" \
  --command="uv run pytest --cov --cov-report=json > /dev/null && jq -r '.totals.percent_covered' coverage.json" \
  --goal=80 \
  --end="2026-10-01"

This created a new file – smallsteps.toml – which holds the configuration of our ratchet:

# Smallsteps Configuration

[[ratchets]]
name = "Pytest Coverage"
start = 2026-06-25
end = 2026-10-01
initial_value = 57.142857142857146
goal_value = 80
command = "uv run pytest --cov --cov-report=json > /dev/null && jq -r '.totals.percent_covered' coverage.json"

Note

  • You don't need to memorize the command parameters, smallsteps add walks you through them interactively.
  • Ratchets can be increasing or decreasing. Percentages (56%) are parsed as floats (.56). So make sure that your goal matches the format of the command output.

You can inspect, add or modify the ratchets using the the toml file.

Checking your Ratchets

Run uvx smallsteps check to check the status of your ratchets. To simulate the future you can run with --date, e.g.:

uv smallsteps check --date 2026-10-31
Evaluating 1 ratchet(s)...

Pytest Coverage: BEHIND (Current: 57.14, Expected Min: 80.00)

Progress check failed.

shows that on the goal date the check will fail if we do not achieve 80% test coverage.

CI and reading values from env

When running smallsteps check all commands to gather your metrics are run by smallsteps. This may be not the desired behaviour in CI because you want to run the checks in different workflows / actions and do not want to use smallsteps as a central orchestrator.

By default smallsteps looks for environment variables matching the ratchets before running the command. E.g. if SMALLSTEPS_PYTEST_COVERAGE is present, the coverage is not re-computed. You can use this in CI to pass outputs from test workflow into the smallsteps action. To get a scaffolding github action with the required input vars for your ratchets run uvx smallsteps ci.

Have a look at the action and the whole workflow (not provided by a command because too specific for your setup) to see how the plumbing can work.

Installation

This documentaion assumes you are using uv, hence you don't need to do anything despite using the uv tool command (ux) to install and run smallsteps.

License

MIT

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

smallsteps-0.1.2.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

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

smallsteps-0.1.2-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file smallsteps-0.1.2.tar.gz.

File metadata

  • Download URL: smallsteps-0.1.2.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smallsteps-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6a6b3dc3e2f758959feda3cc4582d815c292f5ecf845b40ce8786f251f0e6ef0
MD5 276400abadc7d1f14fe98090ce7d4aaf
BLAKE2b-256 9ea7bd262b53abf7cd494c7e6b1bff052ceb11921e2e283600821212c034c8f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for smallsteps-0.1.2.tar.gz:

Publisher: ci.yaml on aehm03/smallsteps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smallsteps-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: smallsteps-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smallsteps-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b2465203ec1babb17de82ec8b06438a3cbbf2254e9a0d8cad55061440923d5f
MD5 4afdcc1735f6fa75bbe84044a851b1e4
BLAKE2b-256 245b0de28650f4eca5e83ee2a5538a743a0143880c073c849eef056a02173d0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for smallsteps-0.1.2-py3-none-any.whl:

Publisher: ci.yaml on aehm03/smallsteps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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