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 improve over time – and to enforce them via local 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: you will increase your coverage and bump up the minimum percentage 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 exact target value required for the current day (e.g., after 50 days, you need at least 60% coverage) and fails the build if your codebase falls behind the trend line.

Example

We use this repository itself as an example to enforce our test coverage tracking. To create a new coverage ratchet, run:

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 automatically initializes a smallsteps.toml file in your project root to hold your configuration:

# 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 2>&1 && jq -r '.totals.percent_covered' coverage.json"

Note

  • You don't need to memorize CLI parameters as smallsteps add walks you through them interactively.
  • Ratchets can be increasing or decreasing
  • Ensure your --goal representation matches your command's output format (e.g., if your tool outputs 85%, use a goal of 100%; if it outputs raw floats like 85.0, match it with 100).
  • It's allways a good idea to mute commands outputs (using > /dev/null 2>&1) to make the result parsing easier.

You can inspect, add or modify the ratchets using the config file. In it you can also find another example using basedpyright.

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

Running smallsteps executes the underlying shell commands to evaluate the ratchet health. In CI/CD, you may prefer to compute metrics once during separate pipeline steps rather than using smallsteps as a task orchestrator.

To accommodate this, smallsteps searches the shell environment for matching SMALLSTEPS_ variables before running any 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 a another workflow into the smallsteps action. To bootstrap a github action containing the required input vars mapped to your ratchets run uvx smallsteps ci.

Have a look at the smallsteps action and the whole workflow (not created by a command because too specific for your setup) to see an example of the wiring.

Installation

This documentation assumes you are using uv, hence you don't need follow any manual steps and can run smallsteps on the fly using th uv tool command (uvx). All other ways of managing python dependencies will work as well.

License

MIT

Inspiration

"It gets easier. Every day it gets a little easier. But you got to do it every day. That's the hard part. But it does get easier."

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.7.tar.gz (45.3 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.7-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smallsteps-0.1.7.tar.gz
  • Upload date:
  • Size: 45.3 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.7.tar.gz
Algorithm Hash digest
SHA256 b25bdf3f459be9b6ed9f602ed7b9a43fe9a89e870abd68ddcb6504d135f15051
MD5 ef9df499d19be1906a18498abb59365c
BLAKE2b-256 1e5b34bde675bd6c1ae979a676e7c8b124c0b9184ab8d54194cdb39ae246b175

See more details on using hashes here.

Provenance

The following attestation bundles were made for smallsteps-0.1.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: smallsteps-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 12.2 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0f356524b6db450943fbce2578a0ba8115afdfcc5f772a3f9f49fb234e1417a8
MD5 4d9ef33bb4ad6a9e57d5aaca4ac16b67
BLAKE2b-256 130bc61e74e1521796fe1b095c4d3a4aeec4b673366c9709d732173b9458bb84

See more details on using hashes here.

Provenance

The following attestation bundles were made for smallsteps-0.1.7-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