Skip to content

Commit

Permalink
feat: added cli example to project
Browse files Browse the repository at this point in the history
  • Loading branch information
sidisinsane committed Mar 26, 2024
1 parent c7f5c68 commit c57a72b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion project/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"numpy>=1.26.4"
"numpy>=1.26.4",
"click>=8.1.7",
]

[project.urls]
Documentation = "https://{{ repository_provider }}/{{ repository_namespace }}/{{ repository_name }}#readme"
Issues = "https://{{ repository_provider }}/{{ repository_namespace }}/{{ repository_name }}/issues"
Source = "https://{{ repository_provider }}/{{ repository_namespace }}/{{ repository_name }}"

[project.scripts]
cli = "{{python_package_import_name}}.cli:{{python_package_import_name}}"

[tool.hatch.version]
path = "src/{{ python_package_import_name }}/__about__.py"

Expand Down
15 changes: 15 additions & 0 deletions project/src/{{ python_package_import_name }}/cli/__init__.py.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: {{ copyright_date }}-present {{ copyright_holder }} <{{ copyright_holder_email }}>
#
# SPDX-License-Identifier: {{ copyright_license }}
import click
from {{python_package_import_name}}.__about__ import __version__


@click.group(
context_settings={"help_option_names": ["-h", "--help"]},
invoke_without_command=True,
)
@click.version_option(version=__version__, prog_name="{{project_name}}")
def {{python_package_import_name}}():
"""Command-line interface for the '{{project_name}}' application."""
click.echo("Hello world!")

0 comments on commit c57a72b

Please sign in to comment.