From a6f8b888e12dcbb1a70cfe812a547c39bda33270 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Tue, 28 Jan 2025 15:43:25 -0500 Subject: [PATCH] Add profiling command --- .gitignore | 5 ++++- pyproject.toml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b00daf4b..0a0c4a71 100644 --- a/.gitignore +++ b/.gitignore @@ -183,4 +183,7 @@ rendercv_output/ !/examples/*.yaml # Mac: -.DS_Store \ No newline at end of file +.DS_Store + +# Profiling: +render_command.prof \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d66790cf..2ca7edec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -134,6 +134,7 @@ dependencies = [ "pytest==8.3.4", # to run the tests "coverage==7.6.10", # to generate coverage reports "pypdf==5.1.0", # to read PDF files + "snakeviz==2.2.2", # for profiling ] features = ["full"] # to install full optional dependencies [tool.hatch.envs.default.scripts] @@ -151,6 +152,8 @@ precommit = "pre-commit run --all-files" # hatch run pre-commit test = "pytest" # hatch run test # Run the tests and generate the coverage report as HTML: test-and-report = "coverage run -m pytest && coverage combine && coverage report && coverage html --show-contexts" # hatch run test-and-report +# Profile render command +profile-render-command = "python -m cProfile -o render_command.prof -m rendercv render examples/John_Doe_ClassicTheme_CV.yaml && snakeviz render_command.prof" [tool.hatch.envs.test] template = "default" @@ -181,7 +184,6 @@ update-schema = "python docs/update_schema.py" # hatch run docs:update-schema update-examples = "python docs/update_examples.py" # hatch run docs:update-examples # Update entry figures in "Structure of the YAML File" page: update-entry-figures = "python docs/update_entry_figures.py" # hatch run docs:update-entry-figures - # ====================================================================================== # Virtual Environments Above =========================================================== # ======================================================================================