Skip to content

A Sample Project For Python - Badge, CLI, Code Climate, Docker, GitHub Pages, Linter configuration, Packaging, {GitHub,PyPI,GitHub Container Registry} releaser CI, Type Hints, pre-commit.ci, ...

License

eggplants/my-best-python-project

Repository files navigation

My best python project

PyPI Release Package

Maintainability Test Coverage Test

pre-commit.ci status pages-build-deployment

This is a sample project.

Installation

pip install git+https://github.com/eggplants/my-best-python-project
# or,
pip install my-best-python-project

Usage

CLI

$ mbpp -h
usage: mbpp [-h] [-o PATH] [--overwrite] [-q] [-V]

This command prints package's version.

optional arguments:
  -h, --help              show this help message and exit
  -o PATH, --output PATH  output to file (default: None)
  --overwrite             overwrite when using `-o` (default: False)
  -q, --quiet             quiet mode (default: False)
  -V, --version           show program's version number and exit

note:
    This package and tool is a sample.

$ mbpp
This package's version is: 0.0.1

$ mbpp -q
0.0.1

$ mbpp -o test.txt
Output: File 'test.txt'

$ mbpp -o test.txt
Error: File 'test.txt' exists. To overwrite, use `--overwrite`.

$ mbpp -o test.txt --overwrite
Output: File 'test.txt'

Library

To print this package's version:

import my_best_python_project

print(my_best_python_project.__version__)

Docker

To pull and rename:

docker pull ghcr.io/eggplants/my-best-python-project
docker tag ghcr.io/eggplants/my-best-python-project mbpp
docker rmi ghcr.io/eggplants/my-best-python-project

To run:

$ docker run --rm -it mbpp -h
This package's version is: 0.0.2

$ docker run --rm -it mbpp -h
usage: mbpp [-h] [-o PATH] [--overwrite] [-q] [-V]

This command prints package's version.

options:
  -h, --help              show this help message and exit
  -o PATH, --output PATH  output to file (default: None)
  --overwrite             overwrite when using `-o` (default: False)
  -q, --quiet             quiet mode (default: False)
  -V, --version           show program's version number and exit

note:
    This package and tool is a sample.

Development

To setup development environment:

pip install -e ".[all]"
pre-commit install

To run pre-commit hooks manually:

pre-commit run
# or,
pre-commit run --all-files

Create release

To create release with GitHub Release and publish packages on PyPI and GitHub Container Registry:

# update: `__version__` of `my_best_python_project/__init__.py`
# commit
git add . && git commit -m "update: <version>" && git push
# tag
git tag vX.Y.Z && git push --tags

License

MIT License

About

A Sample Project For Python - Badge, CLI, Code Climate, Docker, GitHub Pages, Linter configuration, Packaging, {GitHub,PyPI,GitHub Container Registry} releaser CI, Type Hints, pre-commit.ci, ...

Resources

License

Stars

Watchers

Forks