From 6809feec77d1def4a873f485ddcdd57a74287d11 Mon Sep 17 00:00:00 2001 From: John Lapeyre Date: Mon, 11 Aug 2025 08:53:49 -0400 Subject: [PATCH] Allow installing an executable script pygridsynth For example, with pip install . or pip install -e . --- README.md | 28 +++++++++++++++++++++++++++- pygridsynth/__init__.py | 2 ++ setup.py | 9 +++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 setup.py diff --git a/README.md b/README.md index 9a11c68..cb8551b 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,35 @@ Or, to install from source: pip install git+https://github.com/quantum-programming/pygridsynth.git ``` +### Install executable + +You can optionally install an executable script called `pygridsynth` with + +```bash +pip install . +``` + +Or, to install in development (editable) mode + +```bash +pip install -e . +``` + +The versions of `pygridsynth` available on pypi do not yet support +installing an executable in this way. + +Once you have installed this executable, you can use `pygridsynth` like this + +```sh +shell> pygridsynth [options] +``` + +or `pygridsynth --help` for brief information on calling the script. + ## Usage -`pygridsynth` can be used as a command-line tool. +`pygridsynth` can be used as a command-line tool even if you have not installed the +executable. ### Command-Line Example diff --git a/pygridsynth/__init__.py b/pygridsynth/__init__.py index 294e964..68dd8ed 100644 --- a/pygridsynth/__init__.py +++ b/pygridsynth/__init__.py @@ -1 +1,3 @@ from .gridsynth import * + +from .__main__ import main diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..925bc1c --- /dev/null +++ b/setup.py @@ -0,0 +1,9 @@ +from setuptools import setup, find_packages + +setup( + entry_points={ + 'console_scripts': [ + 'pygridsynth = pygridsynth.__main__:main', + ], + } +)