Use hatch build system to add cli entrypoint
This commit is contained in:
parent
d96a9bb616
commit
5be71fc7da
3 changed files with 15 additions and 3 deletions
|
@ -9,3 +9,15 @@ dependencies = [
|
||||||
"python-tgpt>=0.8.1",
|
"python-tgpt>=0.8.1",
|
||||||
"yt-dlp>=2025.1.15",
|
"yt-dlp>=2025.1.15",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
summarize = "summarize:cli"
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
requires = ["hatchling"]
|
||||||
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
|
[tool.hatch.build.targets.wheel]
|
||||||
|
packages = [
|
||||||
|
"summarize.py",
|
||||||
|
]
|
||||||
|
|
|
@ -92,7 +92,7 @@ def rm_dir(dir: Path | str) -> None:
|
||||||
type=str,
|
type=str,
|
||||||
help="Use custom prompt.",
|
help="Use custom prompt.",
|
||||||
)
|
)
|
||||||
def process_file(
|
def cli(
|
||||||
file_path: Path | str, json_transcript: bool, youtube: bool, prompt: str
|
file_path: Path | str, json_transcript: bool, youtube: bool, prompt: str
|
||||||
):
|
):
|
||||||
"""Provide summary for a file at the specified path or a youtube video at the specified url."""
|
"""Provide summary for a file at the specified path or a youtube video at the specified url."""
|
||||||
|
@ -118,4 +118,4 @@ def process_file(
|
||||||
print(summarize_text_file(content, prompt))
|
print(summarize_text_file(content, prompt))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
process_file()
|
cli()
|
||||||
|
|
2
uv.lock
2
uv.lock
|
@ -485,7 +485,7 @@ wheels = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pytgpt-summarize"
|
name = "pytgpt-summarize"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = { virtual = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "click" },
|
{ name = "click" },
|
||||||
{ name = "python-tgpt" },
|
{ name = "python-tgpt" },
|
||||||
|
|
Loading…
Reference in a new issue