Skip to main content

Delfino core plugin

Project description

🔌  Delfino Core   🔌

A Delfino plugin with core functionality.

CircleCI Codecov GitHub tag (latest SemVer) Maintenance GitHub last commit PyPI - Python Version Downloads

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 commands
    • lint - 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]
# 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 = []

# Coommand groups and commands to run as a quality gate in given order.
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"]

# 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.

mypy

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

vcs

[tool.delfino.plugins.delfino-core.vcs]
# Enable to manually specify the branch prefix. By default it is set to git username.
# branch_prefix = ""

[tool.delfino.plugins.delfino-core.vcs.issue_tracking]
# Prefix for issue numbers, including a trailing hyphen if used. If not set, just the issue numbers will be used.
# issue_prefix = "ISSUE-"

# URL for the issue tracker. If not set, issue tracker integration will be disabled.
# Implemented trackers: Jira.
# tracker_url = "https://<SUBDOMAIN>.atlassian.net"

# Environment variable name for the issue tracking username. If not set, 'ISSUE_TRACKER_USERNAME' will be used by default.
# username_env_var = ""

# Environment variable name for the issue tracking API key. If not set, 'ISSUE_TRACKER_API_KEY' will be used by default.
# api_key_env_var = ""

Usage

Run delfino --help.

Development

To develop against editable delfino sources:

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

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

delfino_core-8.1.1.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

delfino_core-8.1.1-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file delfino_core-8.1.1.tar.gz.

File metadata

  • Download URL: delfino_core-8.1.1.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.20 Linux/5.15.0-1057-aws

File hashes

Hashes for delfino_core-8.1.1.tar.gz
Algorithm Hash digest
SHA256 9649635d7df124426c9027d6e81b48668c8a4695a4f9eb6070da517d4fd9b6ae
MD5 7aa1850de44e8e65a2a64762988b79d6
BLAKE2b-256 f3e828f4e790920c6e34c6897098152520404cdd1d7fcd7203cbf6ad0159afe9

See more details on using hashes here.

File details

Details for the file delfino_core-8.1.1-py3-none-any.whl.

File metadata

  • Download URL: delfino_core-8.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.20 Linux/5.15.0-1057-aws

File hashes

Hashes for delfino_core-8.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6926aac3cc33fa0294d0f10b727a57f14ae0511fbe1f1df57e75745c1ed1ee52
MD5 126c58516c94a2d542624c96a07e0e1e
BLAKE2b-256 1e2eb1c15bcc61a1ce4fa6bc1d31601ebfca268b72288a9bb61fd62352f672ff

See more details on using hashes here.

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