From 696370308fc7e83c7c8302b63a5e930396de9d37 Mon Sep 17 00:00:00 2001 From: Russell Schmidt Date: Wed, 2 Apr 2025 12:05:01 -0500 Subject: [PATCH] Rename main to __main__ Most commonly, the __main__.py file is used to provide a command-line interface for a package. __main__.py will be executed when the package itself is invoked directly from the command line using the -m flag. --- .vscode/launch.json | 4 ++-- contact/{main.py => __main__.py} | 0 pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename contact/{main.py => __main__.py} (100%) diff --git a/.vscode/launch.json b/.vscode/launch.json index 6d8c679..fe2dc5b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,8 +6,8 @@ "type": "debugpy", "request": "launch", "cwd": "${workspaceFolder}", - "module": "contact.main", + "module": "contact.__main__", "args": [] } ] -} \ No newline at end of file +} diff --git a/contact/main.py b/contact/__main__.py similarity index 100% rename from contact/main.py rename to contact/__main__.py diff --git a/pyproject.toml b/pyproject.toml index 75f7aa4..96d0301 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,4 +21,4 @@ requires = ["poetry-core>=2.0.0,<3.0.0"] build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] -contact = "contact.main:start" +contact = "contact.__main__:start"