Package: pytemplates-typer-cli
DescriptionA production ready python CLI templateMetadata and dependency information is stored in the pyproject.toml for compatibility with bothpipandpoetry.Flake8,pylint, andisortconfigurations are defined to be compatible with theblackautoformatter.Pylint settings are based on theGoogle Python Style Guideand adapted for black compatibility.Linting tools run automatically before each commit usingpre-commit, black, and isort.Test coverage reports are generated during every commit and pull request usingcoverageandpytest-cov. All reports are automatically uploaded and archived oncodecov.io.Unit tests are written usingpytestand static type checking is provided bymypy.Package releases toPyPIwith dynamic versioning provided bybump2versionbegin automatically whenever a new tag is created in github.Docker images are automatically published toDocker Hubduring every release. Images are tagged with a semantic version number which agrees with the git tag and the PyPI version number.Documentation is built usingmkdocsandmkdocstrings. Docs are automatically deployed togithub pagesduring every release.Release notes are automatically generated during every release usinggithub actions.Full DocumentationInstallationTo install the package usingpip:pipinstallpytemplates_typer_cliTo download the CLI application usingdocker:dockerpullpytemplates/typer_cli:latestUsageUsing the python package installation:pytemplateshellouser
pytemplatesgoodbyeuser
pytemplatesversionUsing the docker image:dockerrun--rmpytemplates/typer_clihellouser
dockerrun--rmpytemplates/typer_cligoodbyeuser
dockerrun--rmpytemplates/typer_cliversionDeveloper SetupTo begin local development, clone thePyTemplates/typer_clirepository and use one of the following methods to build it. Commands should be executed from inside of the project home folder.Using poetrypoetryinstallInstall optional dependencies using the--extrasflag:poetryinstall--extras=environmentUsing pippipinstall.Install optional dependencies using square brackets:pipinstall.[environment]Environmentstest=["pytest","pytest-cov",]lint=["black","isort","flake8","pylint","mypy","pre-commit",]docs=["mkdocs","mkdocstrings","mkdocstrings-python","mkdocs-material",]# Includes all optional dependenciesdev=["pytest","pytest-cov","black","isort","flake8","pylint","mypy","pre-commit","mkdocs","mkdocstrings","mkdocstrings-python","mkdocs-material","bump2version",]Using a local docker buildTo build an image locally from the Dockerfile:makebuildTo run the image:dockerrun--rmpytemplates_typer_clihellouser
dockerrun--rmpytemplates_typer_cligoodbyeuser
dockerrun--rmpytemplates_typer_cliversionCommandsmake clean- Remove all build, testing, and static documentation files.make test- Run the tests using pytest.make lint- Run the linting tools. Includes pre-commit hooks, black, isort, flake8, pylint, and mypy.make check- Run the test and lint commands.make build- Build a docker image locally using the Dockerfile. The image will be namedpytemplates_typer_cli.make gen-docs- Generate HTML documentation.make docs- Generate HTML documentation and serve it to the browser.make pre-release increment={major/minor/patch}- Bump the version and create a release tag. Should only be run from themainbranch. Passes the increment value to bump2version to create a new version number dynamically. The new version number will be added to_version_.pyandpyproject.tomland a new commit will be logged. The tag will be created from the new commit.Workflowstest- Run the tests on every push/pull_request to themainbranch. Writes a coverage report using pytest-cov and uploads it to codecov.io. Tests run against python versions 3.8 and 3.9. Optional manual trigger in the github actions tab.lint- Run the linting tools on every push/pull_request to themainbranch. Includes pre-commit hooks, black, isort, flake8, pylint, and mypy. Optional manual trigger in the github actions tab.docs- Build the documentation, publish to thedocsbranch, and release to github pages. Runs on a manual trigger in the github actions tab.docker- Build the docker image, tag it with the branch name, and publish it to dockerhub. Runs on a manual trigger in the github actions tab.release- Build a wheel distribution, build a docker image, create a github release, and publish to PyPI and Docker Hub whenever a new tag is created. Linting and testing steps must pass before the release steps can begin. Documentation is automatically published to thedocsbranch and hosted on github pages. All github release tags, docker image tags, and PyPI version numbers are in agreement with one another and follow semantic versioning standrads.ReleasesA release should consist of the following two steps from a tested, linted, and up to date copy of themainbranch:make pre-release increment={major/minor/patch}- Commit the version bump and create a new tag locally. The version number follows semantic versioning standards (major.minor.patch) and the tag is the version number prepended with a 'v'.git push --follow-tags- Update themainbranch with only the changes from the version bump. Publish the new tag and kick off the release workflow.File Tree.
├──Dockerfile
├──docs
│├──app_reference
││└──app.md
│├──code_reference
││├──module1.md
││└──module2.md
│├──developer_guide
││├──commands.md
││├──developer_setup.md
││├──releases.md
││└──workflows.md
│├──extras
││├──credits.md
││└──file_tree.md
│├──index.md
│└──user_guide
│├──installation.md
│└──usage.md
├──LICENSE
├──Makefile
├──mkdocs.yml
├──poetry.lock
├──pyproject.toml
├──README.md
├──src
│└──pytemplates_typer_cli
│├──core
││├──__init__.py
││├──module1.py
││└──module2.py
│├──__init__.py
│├──main.py
│└──__version__.py
└──tests├──__init__.py├──test_app.py├──test_module1.py└──test_module2.pyCreditsOther python package templateshttps://github.com/waynerv/cookiecutter-pypackagehttps://github.com/AllenCellModeling/cookiecutter-pypackageActionshttps://github.com/JamesIves/github-pages-deploy-actionhttps://github.com/softprops/action-gh-release