From 5d779538765cf9b00838634428973a10ffd93a02 Mon Sep 17 00:00:00 2001 From: Kevin Chau Date: Thu, 2 Feb 2023 19:02:10 +0000 Subject: [PATCH] Update setup.py to expose scripts/* as CLI entrypoints. This allows build systems like [Pants](https://www.pantsbuild.org/docs/reference-pex_binary#codescriptcode) to more easily package this software and create executable binaries from its scripts. --- scripts/create_db.py | 1 + setup.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/create_db.py b/scripts/create_db.py index ee89984..8038cc6 100755 --- a/scripts/create_db.py +++ b/scripts/create_db.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import argparse import gffutils diff --git a/setup.py b/setup.py index 6f86643..01afd7e 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,8 @@ import setuptools +from glob import glob +from os.path import dirname, join + +DIR = (dirname(__file__) or '.') with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() @@ -19,5 +23,6 @@ "console_scripts": [ "pangolin=pangolin.pangolin:main" ] - } + }, + scripts=glob(join(DIR, 'scripts/*.py')), )