From db0a0621bb5cfcd3023008c679c4380e5747e5cb Mon Sep 17 00:00:00 2001 From: msm_sardar Date: Tue, 20 Feb 2024 22:42:33 -0500 Subject: [PATCH] Add entry point for the GUI (run swolfpy in terminal) --- HISTORY.rst | 6 ++++++ README.rst | 14 +++++++++++--- pyproject.toml | 3 +++ swolfpy/__init__.py | 6 +++--- swolfpy/__main__.py | 4 ++++ 5 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 swolfpy/__main__.py diff --git a/HISTORY.rst b/HISTORY.rst index d31c05c..641fd4b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,12 @@ History ======= +1.3.0 (2024-02-20) +------------------ + +* Add entry point for the GUI (run swolfpy in terminal) + + 1.2.0 (2023-07-30) ------------------ diff --git a/README.rst b/README.rst index ec0a290..62ad823 100644 --- a/README.rst +++ b/README.rst @@ -145,9 +145,17 @@ Installation python -8- Run swolfpy in python:: +8- Run swolfpy - import swolfpy as sp - sp.swolfpy() + - In terminal:: + + swolfpy + # or + python -m swolfpy + + - In python:: + + import swolfpy as sp + sp.SwolfPy() .. endInstallation diff --git a/pyproject.toml b/pyproject.toml index 5d2e94a..151b5e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,9 @@ Homepage = "https://swolfpy-project.github.io/" Documentation = "https://swolfpy.readthedocs.io/en/latest/" "Source Code" = "https://github.com/SwolfPy-Project/swolfpy" +[project.scripts] +swolfpy = "swolfpy:SwolfPy" + [tool.setuptools.dynamic] version = {attr = "swolfpy.__version__"} readme = {file = ["README.rst", "HISTORY.rst"]} diff --git a/swolfpy/__init__.py b/swolfpy/__init__.py index 10074ba..2e12efc 100644 --- a/swolfpy/__init__.py +++ b/swolfpy/__init__.py @@ -26,13 +26,13 @@ "Optimization", "Monte_Carlo", "MyQtApp", - "swolfpy", + "SwolfPy", ] -__version__ = "1.2.0" +__version__ = "1.3.0" -class swolfpy: +class SwolfPy: def __init__(self): if not QtWidgets.QApplication.instance(): self.app = QtWidgets.QApplication(sys.argv) diff --git a/swolfpy/__main__.py b/swolfpy/__main__.py new file mode 100644 index 0000000..19be7d0 --- /dev/null +++ b/swolfpy/__main__.py @@ -0,0 +1,4 @@ +from . import SwolfPy + +if __name__ == "__main__": + SwolfPy()