From 5f403a3d8012fe9b5ca847d7b3094b64e137090f Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 10 Sep 2016 08:26:48 +0200 Subject: [PATCH] Add a umap entry point, so we can pip install umap --- setup.py | 5 ++++- umap/bin/__init__.py | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 umap/bin/__init__.py diff --git a/setup.py b/setup.py index 0ac44a2f..bd81b852 100644 --- a/setup.py +++ b/setup.py @@ -38,4 +38,7 @@ setup( "Topic :: Software Development :: Libraries :: Python Modules", "Programming Language :: Python", ], -) + entry_points={ + 'console_scripts': ['umap=umap.bin:main'], + }, + ) diff --git a/umap/bin/__init__.py b/umap/bin/__init__.py new file mode 100644 index 00000000..0a252ac3 --- /dev/null +++ b/umap/bin/__init__.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +import os + +from django.core import management + + +def main(): + os.environ.setdefault( + "DJANGO_SETTINGS_MODULE", + "umap.settings" + ) + management.execute_from_command_line() + + +if __name__ == '__main__': + main()