From 4c051409b6421c6ba63eae1cfe8075f51c082eaf Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Thu, 17 Aug 2017 20:25:55 -0700 Subject: [PATCH 1/2] define entry point for the plasma store --- python/pyarrow/__init__.py | 10 ++++++++++ python/setup.py | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py index 8d4a214ba26..fbdc8cf1827 100644 --- a/python/pyarrow/__init__.py +++ b/python/pyarrow/__init__.py @@ -105,6 +105,16 @@ localfs = LocalFileSystem.get_instance() +# Entry point for starting the plasma store + +def start_plasma_store(): + import os + import pyarrow + import subprocess + import sys + plasma_store_executable = os.path.join(pyarrow.__path__[0], "plasma_store") + process = subprocess.Popen([plasma_store_executable] + sys.argv[1:]) + process.wait() # ---------------------------------------------------------------------- # 0.4.0 deprecations diff --git a/python/setup.py b/python/setup.py index ebf28cc64e9..f4ba7da7eba 100644 --- a/python/setup.py +++ b/python/setup.py @@ -382,6 +382,11 @@ def has_ext_modules(foo): 'clean': clean, 'build_ext': build_ext }, + entry_points = { + 'console_scripts': [ + 'plasma_store = pyarrow:start_plasma_store' + ] + }, use_scm_version={"root": "..", "relative_to": __file__}, setup_requires=['setuptools_scm', 'cython >= 0.23'], install_requires=['numpy >= 1.10', 'six >= 1.0.0'], From eddc487ac9599c16d348963f9bd2d0dab288db6f Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Fri, 18 Aug 2017 11:47:38 -0700 Subject: [PATCH 2/2] make plasma store entry point private --- python/pyarrow/__init__.py | 8 +++++++- python/setup.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py index fbdc8cf1827..d0348b43c50 100644 --- a/python/pyarrow/__init__.py +++ b/python/pyarrow/__init__.py @@ -107,7 +107,13 @@ # Entry point for starting the plasma store -def start_plasma_store(): +def _plasma_store_entry_point(): + """Entry point for starting the plasma store. + + This can be used by invoking e. g. ``plasma_store -s /tmp/plasma -m 1000000000`` + from the command line and will start the plasma_store executable with the + given arguments. + """ import os import pyarrow import subprocess diff --git a/python/setup.py b/python/setup.py index f4ba7da7eba..4657da0bf86 100644 --- a/python/setup.py +++ b/python/setup.py @@ -384,7 +384,7 @@ def has_ext_modules(foo): }, entry_points = { 'console_scripts': [ - 'plasma_store = pyarrow:start_plasma_store' + 'plasma_store = pyarrow:_plasma_store_entry_point' ] }, use_scm_version={"root": "..", "relative_to": __file__},