diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py index 8d4a214ba26..d0348b43c50 100644 --- a/python/pyarrow/__init__.py +++ b/python/pyarrow/__init__.py @@ -105,6 +105,22 @@ localfs = LocalFileSystem.get_instance() +# Entry point for starting the 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 + 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..4657da0bf86 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:_plasma_store_entry_point' + ] + }, use_scm_version={"root": "..", "relative_to": __file__}, setup_requires=['setuptools_scm', 'cython >= 0.23'], install_requires=['numpy >= 1.10', 'six >= 1.0.0'],