Skip to content

Commit bbe598b

Browse files
committed
Add --target argument to setup.py for selecting dynd/dynd.ndt/dynd.nd installs.
1 parent fdae0da commit bbe598b

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

setup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
from subprocess import check_output
1111

1212
import re
13+
import argparse
14+
15+
# Pre-parse and remove the '--target' argument from sys.argv since we
16+
# need it here already.
17+
parser = argparse.ArgumentParser()
18+
parser.add_argument('--target', default='all')
19+
values, rest = parser.parse_known_args()
20+
DIST_TARGET = values.target
21+
sys.argv = sys.argv[:1] + rest
1322

1423
#
1524
# DyND is a namespace package that contains the type module dynd.ndt and
@@ -32,11 +41,10 @@
3241
# option 2) followed by option 3). All options require a clean build
3342
# directory. At the minimum build/, dist/ and dynd.egg* must be removed.
3443
#
35-
DIST_TARGET = 'all'
3644
class Target():
3745
def __init__(self, target):
3846
if target not in ['ndt', 'nd', 'all']:
39-
raise ValueError("unknown distribution target: %s" % target)
47+
raise ValueError("unknown distribution target: '%s'" % target)
4048
self.target = target
4149

4250
def get_name(self):

0 commit comments

Comments
 (0)