Bastet Python Developers Tools (https://github.com/mewbotorg/bastet)
Project description
Bastet
Bastet, the cat god, takes all of our tests and puts them in one basket.
Bastet is another attempt to simplify linting and testing python projects. It runs a range of linting tools, parses the output, and outputs reports in different formats based on the use case.
The aim of these tools is that, if you run them on a code base, you should end up with something which conforms to your organisations style guidelines, and passes a variety of
Functionality
While developing mewbot we built a number of tools to assist with development.
This mostly consist of tool chains for:
- Automatically reformatting code.
- Managing license / copyright information.
- Running static analysis tooling.
- Checking the code base against style requirements.
And it can output in a variety of ways:
- Simple lists of issues for local development.
- CI output format for GitHub workflows
- Reports for ingestion by Sonar.
Usage
The dev tools uses path based auto-discovery to locate the relevant code.
Python modules will be discovered in folders called src
and test
which are not exclude by version control.
If your project is in that src-dir
layout, you can install bastet
and then run any of the toolchains.
pip install bastet
bastet # Runs all the tests
# You can also run just some sections
bastet format # Automated formatting, using black/isort/ruff
bastet lint # Code style and type linting, using black/flake8/ruff/mypy/pylint
bastet audit # Audit and security checks, using bandit
bastet --help # See the command line options
We also recommend that you set up mewbot-prefilght
as a
pre-commit or pre-push hook.
Configuration
The default unconfirmed mode of Bastet is to run all of its tools (be they code formatting, linting, or auditing) and outputting a list of issues.
The recommended pyproject.toml
to set up your
project can be found in the examples
folder. It enables all of the ruff
linting rules, excluding a few which conflict with each other.
It also disables the black
and isort
formatting tools, which ruff
provides an implementation of.
Advance Config and Debug
You can check what the configuration is doing with --debug
the debug flag on
a run, or by running python -m bastet.config
to just run the configuration steps.
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 bastet-0.0.20.dev12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b27265516e27e8f56530cee3b1b674ce3d8e666aca8e4baf5b4a6c4f69137d1 |
|
MD5 | 30dda6b2e3132fac0839ab5fc4f2a70d |
|
BLAKE2b-256 | a6feba5008a56032ecff7e2e5610361a8dada65b16c3d0609808967cd482568a |