From 842a749f085f9e3098e3163f7c392bac75da4aab Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Fri, 20 Oct 2023 19:50:50 +0200 Subject: [PATCH] fix entry point --- pyproject.toml | 6 +++--- rendercv/__main__.py | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b9ee883..2ab60f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = 'rendercv' description = 'LaTeX CV generator from a YAML/JSON file' -version = '0.3' +version = '1.0' authors = [{ name = 'Sina Atalay' }] requires-python = '>=3.10' readme = "README.md" @@ -23,7 +23,7 @@ classifiers = [ "Intended Audience :: Education", "Topic :: Text Processing :: Markup :: LaTeX", "Topic :: Printing", - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -36,7 +36,7 @@ Documentation = 'https://sinaatalay.github.io/rendercv/' Source = 'https://github.com/sinaatalay/rendercv' [project.scripts] -rendercv = 'rendercv.__main__:main' +rendercv = 'rendercv.__main__:cli' [project.optional-dependencies] docs = ["mkdocs", "mkdocs-material", "mkdocstrings-python"] diff --git a/rendercv/__main__.py b/rendercv/__main__.py index 712a9e1..86c7617 100644 --- a/rendercv/__main__.py +++ b/rendercv/__main__.py @@ -25,6 +25,11 @@ def render( typer.Argument(help="Name of the YAML input file"), ] ): + """Generate a LaTeX CV from a YAML input file. + + Args: + input_file (str): Name of the YAML input file + """ try: file_path = os.path.abspath(input_file) data = read_input_file(file_path) @@ -37,6 +42,11 @@ def render( @app.command(help="Generate a YAML input file to get started") def new(name: Annotated[str, typer.Argument(help="Full name")]): + """Generate a YAML input file to get started. + + Args: + name (str): Full name + """ try: environment = Environment( loader=PackageLoader("rendercv", os.path.join("templates")), @@ -58,5 +68,9 @@ def new(name: Annotated[str, typer.Argument(help="Full name")]): typer.Abort() -if __name__ == "__main__": +def cli(): + """Start the CLI application. + + This function is the entry point for RenderCV. + """ app()