Skip to main content

However it suits you

Project description

Logo

Suit

Suit is a simple, Pythonic way to handle generic task management for your repository. It can handle regular repositories fine, but it's in monorepos where the versatility of this tool shines the most.

System Requirements

To use Suit on your system, you need:

  • Python (>=3.8)
  • pip

...And that's it.

Installation Guide

Installing Suit is just a pip install away!

> pip install python-suit

Usage Guide

The root configurations

Using Suit first requires a file named suit.toml at the root of your repository.

# suit.toml
[suit]

Suit actively searches for the suit.toml file. Without that file, the program won't work. The suit.toml file has 2 uses:

  1. It's the file where general configurations are set.
  2. The location of the file determines the root path of the project.

Target Scripts - Inlined

You can configure scripts by adding scripts in a [tool.suit.target.scripts] section in pyproject.toml files.

[tool.suit.target.scripts]
hello = 'echo "Hello"'
world = 'echo " world"'
but-with-energy = 'echo "!"'

You can run each individually by running

> suit run hello world but-with-shouting

But you can also bundle multiple commands together by creating compounding-scripts.

[tool.suit.target.scripts]
hello = 'echo "Hello"'
world = 'echo " world"'
but-with-energy = 'echo "!"'

hello-world = [
  {ref = 'hello'},
  {ref = 'world'},
  {ref = 'but-with-energy'},
]

And then the compound script.

> suit run hello-world

Target Scripts - Inheritance

Settings scripts inside targets is fine, but in monorepos we expect a lot of those scripts to repeat themselves.

That's why Suit offers a templating solution for targets!

Creating a template means adding a [suit.templates.XXX] table in the suit.toml file, where XXX is the designated template name.

The following is an example for a template named helloer, which provides the scripts from the previous example.

# suit.toml
[suit.templates.helloer.scripts]

hello = 'echo "Hello"'
world = 'echo "world"'
but-with-shouting = 'echo "!!"'

hello-world = [
    {ref = 'hello'},
    {ref = 'world'},
    {ref = 'but-with-shouting'}
]

And in the pyproject.toml the previously held those scripts, the following can now be put:

# pyproject.toml
[tool.suit.target]
inherit = ['helloer']

Roadmap

Suit is not close to be done. There are plenty of great ideas in where this project will go.

Among the best ones:

  • Configurable virtualenvs management.
  • pre-commit-hooks integration.
  • Parallelization

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

python-suit-0.0.3a3.tar.gz (8.8 kB view hashes)

Uploaded Source

Built Distribution

python_suit-0.0.3a3-py3-none-any.whl (12.2 kB view hashes)

Uploaded Python 3

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