Skip to main content

A CLI tools and hooks on my shelf

Project description

CLI on the Shelf

test codecov pypi version PyPI - Python Version size code style: black gh license

A CLI tools and hooks on my shelf for my any Python packages. This project help me to make Versioning, run Abbreviate of Git CLI.

[!NOTE] This project was created because I do not want to hard code set up all of them every time when I start create a new Python package :tired_face:. I provide some reusable CLIs that was implemented by Click.

:round_pushpin: Installation

pip install -U clishelf

In the future, I will add more the CLI tools that able to dynamic with many style of config such as I want to make changelog file with style B by my custom message code.

Dependency supported:

Python Version Installation Support Fixed Bug
== 3.8 pip install "clishelf<=0.1.10" :x:
>=3.9.13,<3.14 pip install -U clishelf :heavy_check_mark:

[!WARNING] This package already install pre-commit with the latest version.

:rocket: Pre-Commit Hook

See pre-commit for instructions

- repo: https://github.com/korawica/clishelf
  rev: v0.2.19
  hooks:
    - id: shelf-commit-msg
      stages: [commit-msg]

:tada: Features

This Utility Package provide some CLI tools for handler development process.

Usage: shelf.exe [OPTIONS] COMMAND [ARGS]...

  The Main Shelf commands.

Commands:
  conf   Return config for clishelf commands
  cove   Run the coverage command.
  dep    List of Dependencies that was set in pyproject.toml file.
  emoji  The Emoji commands
  git    The Extended Git commands
  vs     The Versioning commands.

Extended Git

This is abbreviation of Git CLI that warped with the Python subprocess package.

Usage: shelf.exe git [OPTIONS] COMMAND [ARGS]...

  The Extended Git commands

Commands:
  bn-clear     Clear Local Branches that sync from the Remote repository.
  cm           Prepare and show the latest commit message with the commit...
  cm-prev      Commit changes to the Previous Commit with same message.
  cm-revert    Revert the latest Commit on the Local repository.
  mg           Merge change from another branch with strategy, `theirs`...
  tg-clear     Clear Local Tags that sync from the Remote repository.

Versioning

This is the enhancement bump2version Python package for my bumping style.

Usage: shelf.exe vs [OPTIONS] COMMAND [ARGS]...

  The Versioning commands.

Commands:
  bump       Bump package version with a next tag value with an input...
  changelog  Make a changelog file that generate form previous commits.
  current    Return Current Version that read from ``__about__`` by default.

Emoji

This is the emoji CLI that getting data from GitHub dataset.

Usage: shelf.exe emoji [OPTIONS] COMMAND [ARGS]...

  The Emoji commands

Commands:
  fetch  Refresh emoji metadata file on assets folder.

:cookie: Configuration

Basic Setting

.clishelf.yaml:

version:
  version: "./clishelf/__about__.py"
  changelog: "CHANGELOG.md"
  mode: "normal"

pyproject.toml:

[tool.shelf.version]
version = "./clishelf/__about__.py"
changelog = "CHANGELOG.md"
mode = "normal"

[!IMPORTANT] The bump version mode able to be normal or datetime only.

Override Commit Prefix

git:
  commit_prefix:
    - ["comment", "Documents", ":bulb:"]  # 💡
    - ["typos", "Documents", ":pencil2:"]  # ✏️
  commit_prefix_group:
    - ["Features", ":tada:"]  # 🎉
Module Key Default Description
git commit_prefix None Commit prefix that want to override/append
commit_prefix_group None Commit prefix group that want to override/append
commit_msg_format "{emoji} {prefix}: {subject}" Commit message format that use to prepare
commit_prefix_pre_demojize True Auto de-emoji on a commit log subject
commit_prefix_force_fix False Force fix if commit message does not match with normal form
version version "./{PROJECT-NAME}/__about__.py" Version tracking file location path (with .py format)
changelog "CHANGELOG.md" Changelog file location path
mode "normal" "normal" for normal version
"datetime" for datetime time mode (format %Y%m%d.%pre-release)
commit_subject_format "{emoji} {prefix}: {subject}" Commit subject format that use to writing a changelog file with commit_msg_format
commit_msg_format "- {subject} (_{datetime:%Y-%m-%d}_)" Commit message format that use to writing a changelog file

:dart: Mini-Roadmap

  • (Optional) I will implement use rich and alive-progress to this project for make interface terminal prettier.
  • (Optional) Dynamic emoji changing for support other platform such as GitLab.
  • (BIG) Remove bump2version package and implement my bump function instead.

[!NOTE] I will migrate this code from Python to Rust for performance of this CLI (But I will observe for this again because this package does not have any issue with perf as well).

:speech_balloon: Contribute

I do not think this project will go around the world because it has specific propose, and you can create by your coding without this project dependency for long term solution. So, on this time, you can open the GitHub issue on this project :raised_hands: for fix bug or request new feature if you want it.

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

clishelf-0.2.19.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clishelf-0.2.19-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file clishelf-0.2.19.tar.gz.

File metadata

  • Download URL: clishelf-0.2.19.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clishelf-0.2.19.tar.gz
Algorithm Hash digest
SHA256 e368a12dd4c91054bbc1a9ec610fe6f727bfc4659794a16cabfae1b4d247998c
MD5 58802765e522ada80fcf8363dc4e36fa
BLAKE2b-256 fa64f2ab824c2ac109bca0c8f909fe1cebf29a90fc047ca0fc7e8337a4781339

See more details on using hashes here.

Provenance

The following attestation bundles were made for clishelf-0.2.19.tar.gz:

Publisher: publish.yml on korawica/clishelf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clishelf-0.2.19-py3-none-any.whl.

File metadata

  • Download URL: clishelf-0.2.19-py3-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clishelf-0.2.19-py3-none-any.whl
Algorithm Hash digest
SHA256 4885f36c8e0bc6bee8b04bda7db00415479ec7386e97a15e6905f3554944f080
MD5 580ad3a10ad4d523958d3b489eae68d2
BLAKE2b-256 1fedec89b6265ed3ba63a708bd27c8d94dc819273cd85035879153b0769b853d

See more details on using hashes here.

Provenance

The following attestation bundles were made for clishelf-0.2.19-py3-none-any.whl:

Publisher: publish.yml on korawica/clishelf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page