From 6cc3a9d9733982b229e2593867813f0dc2b055fa Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Fri, 16 Jan 2015 17:11:21 -0700 Subject: [PATCH] frontend/*: move to artiq.frontend, make entry_points * solves the trouble of having to setup PATH and PYTHONPATH in a project specific way and keep them changing * works well with virtualenvs * works under windows where the shebang is meaningless * works if your python is not named "python3" * can use "pip3 install --user --editable ." * creates an egg-link in ~/.local/share/... pointing to $PWD * generates the scripts and copies them to ~/.local/bin which is likely already in your $PATH * analogously under windows * or call scripts as "python3 -m artiq.frontend.master" --- artiq/frontend/__init__.py | 0 .../artiq_client.py => artiq/frontend/client.py | 0 frontend/artiq_ctlid.py => artiq/frontend/ctlid.py | 0 frontend/artiq_gui.py => artiq/frontend/gui.py | 0 {frontend => artiq/frontend}/lda_client.py | 0 {frontend => artiq/frontend}/lda_controller.py | 0 .../artiq_master.py => artiq/frontend/master.py | 0 {frontend => artiq/frontend}/pdq2_client.py | 0 {frontend => artiq/frontend}/pdq2_controller.py | 0 frontend/artiq_run.py => artiq/frontend/run.py | 0 setup.py | 14 +++++++++++++- 11 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 artiq/frontend/__init__.py rename frontend/artiq_client.py => artiq/frontend/client.py (100%) rename frontend/artiq_ctlid.py => artiq/frontend/ctlid.py (100%) rename frontend/artiq_gui.py => artiq/frontend/gui.py (100%) rename {frontend => artiq/frontend}/lda_client.py (100%) rename {frontend => artiq/frontend}/lda_controller.py (100%) rename frontend/artiq_master.py => artiq/frontend/master.py (100%) rename {frontend => artiq/frontend}/pdq2_client.py (100%) rename {frontend => artiq/frontend}/pdq2_controller.py (100%) rename frontend/artiq_run.py => artiq/frontend/run.py (100%) diff --git a/artiq/frontend/__init__.py b/artiq/frontend/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/artiq_client.py b/artiq/frontend/client.py similarity index 100% rename from frontend/artiq_client.py rename to artiq/frontend/client.py diff --git a/frontend/artiq_ctlid.py b/artiq/frontend/ctlid.py similarity index 100% rename from frontend/artiq_ctlid.py rename to artiq/frontend/ctlid.py diff --git a/frontend/artiq_gui.py b/artiq/frontend/gui.py similarity index 100% rename from frontend/artiq_gui.py rename to artiq/frontend/gui.py diff --git a/frontend/lda_client.py b/artiq/frontend/lda_client.py similarity index 100% rename from frontend/lda_client.py rename to artiq/frontend/lda_client.py diff --git a/frontend/lda_controller.py b/artiq/frontend/lda_controller.py similarity index 100% rename from frontend/lda_controller.py rename to artiq/frontend/lda_controller.py diff --git a/frontend/artiq_master.py b/artiq/frontend/master.py similarity index 100% rename from frontend/artiq_master.py rename to artiq/frontend/master.py diff --git a/frontend/pdq2_client.py b/artiq/frontend/pdq2_client.py similarity index 100% rename from frontend/pdq2_client.py rename to artiq/frontend/pdq2_client.py diff --git a/frontend/pdq2_controller.py b/artiq/frontend/pdq2_controller.py similarity index 100% rename from frontend/pdq2_controller.py rename to artiq/frontend/pdq2_controller.py diff --git a/frontend/artiq_run.py b/artiq/frontend/run.py similarity index 100% rename from frontend/artiq_run.py rename to artiq/frontend/run.py diff --git a/setup.py b/setup.py index e23c601d8..bc5afe10c 100755 --- a/setup.py +++ b/setup.py @@ -26,5 +26,17 @@ setup( (os.path.join("artiq", "gui"), [os.path.join("artiq", "gui", "icon.png")])], ext_modules=[], - scripts=glob(os.path.join("frontend", "*.py")) + entry_points={ + "console_scripts": [ + "artiq_client=artiq.frontend.client:main", + "artiq_ctlid=artiq.frontend.ctlid:main", + "artiq_gui=artiq.frontend.gui:main", + "artiq_master=artiq.frontend.master:main", + "artiq_run=artiq.frontend.run:main", + "lda_client=artiq.frontend.lda_client:main", + "lda_controller=artiq.frontend.lda_controller:main", + "pdq2_client=artiq.frontend.pdq2_client:main", + "pdq2_controller=artiq.frontend.pdq2_controller:main", + ], + } )