Skip to main content

A CLI to generate utils files for new projects.

Project description

Make Repository

CI

mkrp is a command-line tool for initial configuration of tools for a new repository.

mkrp was designed to speed up the creation of configurations that I (the author, @henriquesebastiao) commonly use in my projects (Python preferably). If you see any use in this, feel free to use it and improve it if you want.

Installation

The CLI is available on PyPI and can be installed using pip or pipx:

pipx install mkrp

Usage

The following command creates the following configurations:

  • .gitignore file for Python projects
  • GitHub Actions for Python projects that perform the integration tasks are listed below.
  • Add development tool settings to pyproject.toml for Python projects

Tools configured for Python projects:

  • ruff - Linting
  • blue - Formatting
  • isort - Sorting imports
  • mypy - Static type checking
  • radon - Code complexity checking
  • bandit - Security checking
  • pydocstyle - Docstring checking
  • pytest - Testing
  • taskipy - Task runner
mkrp python

Also configuring a license for the repository with the flag -l or --license:

mkrp python -l

By default, the MIT license will be configured.

Sources

  • The .gitignore file is generated with the gitignore.io api
  • GitHub Actions CI configurations are configured according to the following model:
on: [ push, pull_request ]

name: CI

jobs:
  checks:
    name: Checks
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [ 3.12 ]
        check: [ ruff, blue, isort, pydocstyle, radon, mypy, bandit ]

    steps:
      - uses: actions/checkout@v4
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install Dependencies
        run: |
          python -m pip install --upgrade pip
          pip install poetry
          poetry config virtualenvs.create false
          poetry install
      - name: Run checks
        run: |
          task ${{ matrix.check }}
  • The development tool settings are configured in the pyproject.toml file according to the following model:
[tool.mypy]
ignore_missing_imports = true
check_untyped_defs = true

[tool.isort]
profile = "black"
line_length = 79

[tool.ruff]
line-length = 79
indent-width = 4

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F403", "F401"]
"tests/*" = ["F401", "F811"]

[tool.pytest.ini_options]
pythonpath = "."
python_files = "test.py tests.py test_*.py tests_*.py *_test.py *_tests.py"

[tool.taskipy.tasks]
ruff = "ruff check ."
blue = "blue --check . --diff"
isort = "isort --check --diff ."
mypy = "mypy -p <YOUR-PROJECT>"
radon = "radon cc ./<YOUR-PROJECT> -a -na"
bandit = "bandit -r ./<YOUR-PROJECT>"
pydocstyle = "pydocstyle ./<YOUR-PROJECT> --count --convention=google --add-ignore=D100,D104,D105,D107"
lint = "task ruff && task blue && task isort"
format = 'blue .  && isort .'
quality = "task mypy && task radon && task pydocstyle"
pre_test = "task lint"
test = "pytest -s -x --cov=<YOUR-PROJECT> -vv"
post_test = "coverage html"
export-requirements = "rm requirements.txt && poetry export -f requirements.txt --output requirements.txt --without-hashes"
ready = "task lint && task quality && task bandit && pytest -s -x --cov=<YOUR-PROJECT> -vv && task export-requirements"

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

mkrp-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

mkrp-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file mkrp-0.1.0.tar.gz.

File metadata

  • Download URL: mkrp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.9-arch1-1

File hashes

Hashes for mkrp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 24d17451de7df2e8a5e9314345cbb2371f88de6651217583bd8e66c828ab0c50
MD5 0832a733f7043bc1090e4b18dd2db252
BLAKE2b-256 75db51540bf44bc83be259ca7a8b06ab260278767413549d061193e41ee8fd4c

See more details on using hashes here.

File details

Details for the file mkrp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mkrp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.9-arch1-1

File hashes

Hashes for mkrp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 257419a758cd66bd0ea1da3fea7eb99c93d1a34fe706214bfe93d613d3f2cd00
MD5 ec9ed414a79bfe188cc64d75e973f597
BLAKE2b-256 29a67f865d2ddfc66be85ba00360ad95eed72deb59300795a85887e8759df7c4

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