From 7f68f06fe46e4167502105bc11cb6f20382a22f6 Mon Sep 17 00:00:00 2001 From: delterr Date: Thu, 12 Sep 2024 07:27:19 +0100 Subject: [PATCH 1/2] Added run command in makefile --- Makefile | 4 ++++ project_template/{{module_name}}/__main__.py | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 project_template/{{module_name}}/__main__.py diff --git a/Makefile b/Makefile index 7410cc4..d985908 100644 --- a/Makefile +++ b/Makefile @@ -37,3 +37,7 @@ update-template-packages: ## Update the project using the initial copier templa .PHONY: clean clean: ## Clean the temporary files. rm -rf megalinter-reports + +.PHONY: run +run: ## Run the application + poetry run python ons_python diff --git a/project_template/{{module_name}}/__main__.py b/project_template/{{module_name}}/__main__.py new file mode 100644 index 0000000..536fbf5 --- /dev/null +++ b/project_template/{{module_name}}/__main__.py @@ -0,0 +1,8 @@ +from calculator import Calculator +calc = Calculator() + +calc.add(5) + +calc.subtract(2) + +print(calc.cumulative_total) From 945856df846a51892849900368cc8cbf8ce065c5 Mon Sep 17 00:00:00 2001 From: delterr Date: Thu, 12 Sep 2024 09:36:16 +0100 Subject: [PATCH 2/2] trying module name generalisation --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d985908..c68569d 100644 --- a/Makefile +++ b/Makefile @@ -40,4 +40,4 @@ clean: ## Clean the temporary files. .PHONY: run run: ## Run the application - poetry run python ons_python + poetry run python {{module_name}}