Metadata-Version: 2.1
Name: delfino-core
Version: 3.4.0
Summary: Delfino core plugin
Home-page: https://github.com/radeklat/delfino-core
License: MIT
Author: Radek Lát
Author-email: radek.lat@gmail.com
Requires-Python: >=3.7.2,<4.0.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Provides-Extra: all
Provides-Extra: build-docker
Provides-Extra: dependencies-update
Provides-Extra: format
Provides-Extra: lint
Provides-Extra: test
Provides-Extra: typecheck
Provides-Extra: upload-to-pypi
Provides-Extra: verify-all
Requires-Dist: black ; extra == "all" or extra == "verify-all" or extra == "format"
Requires-Dist: coverage ; extra == "all" or extra == "verify-all" or extra == "test"
Requires-Dist: delfino (>=0.24.0)
Requires-Dist: gitpython ; extra == "all" or extra == "dependencies-update"
Requires-Dist: isort ; extra == "all" or extra == "verify-all" or extra == "format"
Requires-Dist: mypy ; extra == "all" or extra == "verify-all" or extra == "typecheck"
Requires-Dist: packaging ; extra == "all" or extra == "build-docker"
Requires-Dist: pre-commit ; extra == "all" or extra == "verify-all" or extra == "format"
Requires-Dist: psutil ; extra == "all" or extra == "verify-all" or extra == "lint"
Requires-Dist: pycodestyle ; extra == "all" or extra == "verify-all" or extra == "lint"
Requires-Dist: pydocstyle ; extra == "all" or extra == "verify-all" or extra == "lint"
Requires-Dist: pylint ; extra == "all" or extra == "verify-all" or extra == "lint"
Requires-Dist: pytest ; extra == "all" or extra == "verify-all" or extra == "test"
Requires-Dist: pytest-cov ; extra == "all" or extra == "verify-all" or extra == "test"
Requires-Dist: shellingham
Requires-Dist: twine ; extra == "all" or extra == "upload-to-pypi"
Description-Content-Type: text/markdown

<h1 align="center" style="border-bottom: none;"> 🔌&nbsp;&nbsp;Delfino Core&nbsp;&nbsp; 🔌</h1>
<h3 align="center">A <a href="https://github.com/radeklat/delfino">Delfino</a> plugin with core functionality.</h3>

<p align="center">
    <a href="https://app.circleci.com/pipelines/github/radeklat/delfino-core?branch=main">
        <img alt="CircleCI" src="https://img.shields.io/circleci/build/github/radeklat/delfino-core">
    </a>
    <a href="https://app.codecov.io/gh/radeklat/delfino-core/">
        <img alt="Codecov" src="https://img.shields.io/codecov/c/github/radeklat/delfino-core">
    </a>
    <a href="https://github.com/radeklat/delfino-core/tags">
        <img alt="GitHub tag (latest SemVer)" src="https://img.shields.io/github/tag/radeklat/delfino-core">
    </a>
    <img alt="Maintenance" src="https://img.shields.io/maintenance/yes/2022">
    <a href="https://github.com/radeklat/delfino-core/commits/main">
        <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/radeklat/delfino-core">
    </a>
    <a href="https://www.python.org/doc/versions/">
        <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/delfino-core">
    </a>
    <a href="https://pypistats.org/packages/delfino-core">
        <img alt="Downloads" src="https://img.shields.io/pypi/dm/delfino-core">
    </a>
</p>

# Commands
  
| Command               | Description                                         |
|-----------------------|-----------------------------------------------------|
| build-docker          | Build and push a docker image.                      |
| 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.       |
| format                | Runs black code formatter and isort on source code. |
| lint                  | Run linting on the entire code base.                |
| lint-pycodestyle      | Run PEP8 checking on code.                          |
| lint-pydocstyle       | Run docstring linting on source code.               |
| lint-pylint           | Run pylint on code.                                 |
| switch-python-version | Switches Python venv to a different Python version. |
| test-all              | Run all tests, and generate coverage report.        |
| test-integration      | Run integration tests.                              |
| test-unit             | Run unit tests.                                     |
| typecheck             | Run type checking on source code.                   |
| upload-to-pypi        | Upload package to a public Pypi repository.         |
| verify-all            | Runs all verification commands.                     |

# 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](#commands). Therefore, dependencies of all commands are optional and checked only when the command is executed.

Using `[all]` installs all the [optional dependencies](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#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):
  - `upload-to-pypi`
  - `build-docker`
  - `typecheck`
  - `format`
  - `dependencies-update`
- For groups of commands:
  - `test` - for testing and coverage commands
  - `lint` - for all the linting commands
- For groups of groups:
  - `verify-all` - same as `[typecheck,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`:

```toml
[tool.delfino.plugins.delfino-core]

```

## Plugin configuration

This plugin has several options. All the values are optional and defaults are shown below: 

```toml
[tool.delfino.plugins.delfino-core]
# Source files - may have different rules than tests (usually stricter)
sources_directory = "src"

# Test files
tests_directory = "tests"

# Where to store reports generated by various tools
reports_directory = "reports"

# Types of tests you have nested under the `tests_directory`. Will be executed in given order.
test_types = ["unit", "integration"]

# One or more module to wrap `pytest` in, executing it as `python -m <MODULE> pytest ...`
pytest_modules = []

# Commands to run as a quality gate in given order.
verify_commands = ["format", "lint", "typecheck", "test-all"]

# Do not install pre-commit if this is set to true.
disable_pre_commit = false
```

## Commands configuration

Several commands have their own configuration as well:

```toml
[tool.delfino.plugins.delfino-core.dockerhub]
# User name for logging in into dockerhub
username = ""

# Platforms to build with dockerx
build_for_platforms = [
    "linux/arm/v7",
    "linux/arm64",
    "linux/amd64",
]

[tool.delfino.plugins.delfino-core.typecheck]
# One or more directories where type hint will be required. By default they are optional.
strict_directories = []  
```

# Usage

Run `delfino --help`.

# Development

To develop against editable `delfino` sources:

1. Make sure `delfino` sources are next to this plugin:
    ```shell
    cd ..
    git clone https://github.com/radeklat/delfino.git
    ```
2. Install `delfino` as editable package:
    ```shell
    pip install -e ../delfino
    ```
   Note that poetry will reset this to the released package when you install/update anything.

