🔌 Delfino Core 🔌
A Delfino plugin with core functionality.
Commands
Command | Description |
---|
black | Runs black. |
coverage-open | Open coverage results in default browser. |
coverage-report | Analyse coverage and generate a term/HTML report. |
dependencies-update | Manages the process of updating dependencies. |
ensure-pre-commit | Ensures pre-commit is installed and enabled. |
format | Runs ensure-pre-commit, pyupgrade, isort, black. |
gh | Extends gh or passes through. |
glab | Extends glab or passes through. |
isort | Runs isort. |
lint | Runs ruff, pylint, pycodestyle, pydocstyle. |
mypy | Run type checking on source code. |
pre-commit | Run all pre-commit stages in the current project... |
pycodestyle | Run PEP8 checking on code. |
pydocstyle | Run docstring linting on source code. |
pylint | Run pylint on code. |
pytest | Runs pytest for individual test suites. |
pytest-integration | Run integration tests. |
pytest-unit | Run unit tests. |
pyupgrade | Runs pyupgrade with automatic version discovery. |
ruff | Run ruff. |
switch-python-version | Switches Python venv to a different Python version. |
test | Runs pytest, coverage-report. |
vcs | Alias for gh /glab with auto-detection. |
verify | Runs format, lint, mypy, test. |
Installation
- pip:
pip install delfino-core
- Poetry:
poetry add -D delfino-core
- Pipenv:
pipenv install -d delfino-core
Optional dependencies
Each project may use different sub-set of commands. Therefore, dependencies of all commands are optional and checked only when the command is executed.
Using [all]
installs all the optional dependencies used by all the commands. If you want only a sub-set of those dependencies, there are finer-grained groups available:
- For individual commands (matches the command names):
mypy
format
dependencies-update
pre-commit
vsc
- For groups of commands:
test
- for testing and coverage commandslint
- for all the linting commands
- For groups of groups:
verify
- same as [mypy,format,test,lint]
all
- all optional packages
Configuration
Delfino doesn't load any plugins by default. To enable this plugin, add the following config into pyproject.toml
:
[tool.delfino.plugins.delfino-core]
Plugin configuration
This plugin has several options. All the values are optional and defaults are shown below:
[tool.delfino.plugins.delfino-core]
sources_directory = "src"
tests_directory = "tests"
reports_directory = "reports"
test_types = ["unit", "integration"]
pytest_modules = []
verify_commands = ["format", "lint", "mypy", "test"]
format_commands = ["ensure-pre-commit", "pyupgrade", "isort", "black"]
lint_commands = ["ruff", "pylint", "pycodestyle", "pydocstyle"]
test_commands = ["pytest", "coverage-report"]
disable_pre_commit = false
Commands configuration
Several commands have their own configuration as well.
mypy
[tool.delfino.plugins.delfino-core.mypy]
strict_directories = []
vcs
[tool.delfino.plugins.delfino-core.vcs]
[tool.delfino.plugins.delfino-core.vcs.issue_tracking]
Usage
Run delfino --help
.
Development
To develop against editable delfino
sources:
- Make sure
delfino
sources are next to this plugin:
cd ..
git clone https://github.com/radeklat/delfino.git
- Install
delfino
as editable package:
pip install -e ../delfino
Note that poetry will reset this to the released package when you install/update anything.