However it suits you
Project description
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:
- It's the file where general configurations are set.
- 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
virtualenv
s management. pre-commit-hooks
integration.- Parallelization
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
Built Distribution
Hashes for python_suit-0.0.3a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fca7947eb8f49faa6c5c67d88b4226d6b876a11bf69043306e2b2f09f2b2c486 |
|
MD5 | 8d7b37c6a0beeb4d46ff41eec428c611 |
|
BLAKE2b-256 | a980057756aeacecbbab3758b97246ffc801dc4872fe960b3fc1611fa48e3df5 |