From 8d0a1e2380f76f562b062314719d63b511fa75a7 Mon Sep 17 00:00:00 2001 From: Mark Wiebe <399551+mwiebe@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:36:20 -0700 Subject: [PATCH] fix: Usage of __main__.py is not idiomatic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In https://docs.python.org/3/library/__main__.html#main-py-in-python-packages it says: > The content of __main__.py typically isn’t fenced with an > if __name__ == '__main__' block. Instead, those files are kept > short and import functions to execute from other modules. > Those other modules can then be easily unit-tested and are properly reusable. and later > This won’t work for __main__.py files in the root directory of a .zip file > though. Hence, for consistency, a minimal __main__.py without a __name__ > check is preferred. In the last release, we updated __main__.py to be idiomatic, but missed that the pyproject.toml file required the script to be non-idiomatic. This fix corrects usage in pyproject.toml. Signed-off-by: Mark Wiebe <399551+mwiebe@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bcc5d81..8d8f11b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Source = "https://github.com/OpenJobDescription/openjd-cli" [project.scripts] -openjd = "openjd:__main__.main" +openjd = "openjd.cli:main" [tool.hatch.build]