Skip to main content

Helpers to bild a CLI program

Project description

cli-base-utilities

tests codecov cli-base-utilities @ PyPi Python Versions License GPL-3.0-or-later

Helpers to build a CLI program

start development

~$ git clone https://github.com/jedie/cli-base-utilities.git
~$ cd cli-base-utilities
~/cli-base-utilities$ ./dev-cli.py --help

dev CLI

Usage: ./dev-cli.py [OPTIONS] COMMAND [ARGS]...

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ --help      Show this message and exit.                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────╮
│ check-code-style            Check code style by calling darker + flake8                          │
│ coverage                    Run and show coverage.                                               │
│ fix-code-style              Fix code style of all cli_base source code files via darker          │
│ install                     Run pip-sync and install 'cli_base' via pip as editable.             │
│ mypy                        Run Mypy (configured in pyproject.toml)                              │
│ publish                     Build and upload this project to PyPi                                │
│ safety                      Run safety check against current requirements files                  │
│ test                        Run unittests                                                        │
│ tox                         Run tox                                                              │
│ update                      Update "requirements*.txt" dependencies files                        │
│ update-test-snapshot-files  Update all test snapshot files (by remove and recreate all snapshot  │
│                             files)                                                               │
│ version                     Print version and exit                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

DEMO app CLI

Usage: ./cli.py [OPTIONS] COMMAND [ARGS]...

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ --help      Show this message and exit.                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────╮
│ demo-endless-loop                Just a useless example command, used in systemd DEMO: It just   │
│                                  print some information in a endless loop.                       │
│ demo-verbose-check-output-error  DEMO for a error calling                                        │
│                                  cli_base.cli_tools.subprocess_utils.verbose_check_output()      │
│ edit-settings                    Edit the settings file. On first call: Create the default one.  │
│ print-settings                   Display (anonymized) MQTT server username and password          │
│ systemd-debug                    Print Systemd service template + context + rendered file        │
│                                  content.                                                        │
│ systemd-remove                   Write Systemd service file, enable it and (re-)start the        │
│                                  service. (May need sudo)                                        │
│ systemd-setup                    Write Systemd service file, enable it and (re-)start the        │
│                                  service. (May need sudo)                                        │
│ systemd-status                   Display status of systemd service. (May need sudo)              │
│ systemd-stop                     Stops the systemd service. (May need sudo)                      │
│ version                          Print version and exit                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

Generate project history base on git commits/tags

Add a test case similar to cli_base/tests/test_readme_history.py into your project. Add the needed start/end comments into your README.

To make a new release, do this:

  • Increase your project version number
  • Run tests to update the README
  • commit the changes
  • Create release

history

  • v0.4.2
    • 2023-11-01 - Remove duplicate git commits and keep only test last one, e.g.: "update requirements"
    • 2023-11-01 - Bugfix git history: Add commits before the first tag
  • v0.4.1
    • 2023-10-08 - Remove commit URLs from history and handle release a new version
    • 2023-10-08 - NEW: Generate a project history base on git commits/tags.
    • 2023-10-08 - Update requirements
    • 2023-09-26 - Update README.md
  • v0.4.0
    • 2023-09-24 - fix tests
    • 2023-09-24 - Add UpdateTestSnapshotFiles() Context Manager
    • 2023-09-24 - coverage: Refactor setup and add helpers
    • 2023-09-24 - Update requirements
  • v0.3.0
    • 2023-08-17 - Bugfix tests run in terminal
    • 2023-08-17 - update requirements
    • 2023-08-17 - NEW: cli_base.cli_tools.git and cli_base.cli_tools.version_info
  • v0.2.0
    • 2023-08-09 - Project setup updates
    • 2023-05-22 - Update README.md
    • 2023-05-22 - Rename project "cli-base" to "cli-base-utilities"
    • 2023-05-22 - Add github CI config
    • 2023-05-22 - Add subprocess_utils from manageprojects
    • 2023-05-21 - init

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

cli-base-utilities-0.4.2.tar.gz (76.7 kB view details)

Uploaded Source

Built Distribution

cli_base_utilities-0.4.2-py3-none-any.whl (66.3 kB view details)

Uploaded Python 3

File details

Details for the file cli-base-utilities-0.4.2.tar.gz.

File metadata

  • Download URL: cli-base-utilities-0.4.2.tar.gz
  • Upload date:
  • Size: 76.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for cli-base-utilities-0.4.2.tar.gz
Algorithm Hash digest
SHA256 05b643761715f3b5ffd9487186c2517160f11ea355926710d7ca3f0778e36124
MD5 ea83332046643c9184a4777add337f29
BLAKE2b-256 db0c0133cbc32abea0526b4d0e0f0e5b9aa7262d55a9277721fb8318a29c6f5f

See more details on using hashes here.

Provenance

File details

Details for the file cli_base_utilities-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for cli_base_utilities-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e56d6c8dc7c2059e693a7133f1dd5d2334480a529b40b78d76752982a7658f5
MD5 d63913af4ea02551d75e33a2f5f15937
BLAKE2b-256 d67cf6a9cde0ca61be00096e09b11670adb210380434bf38eba7f027540092c5

See more details on using hashes here.

Provenance

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