Skip to content

Commit 4323ac5

Browse files
author
Michal Ostrowski
committed
Add top-level setup.py
This file is basically a symlink to "python/setup.py" expressed in python code. If python executes "setup.py", it will be effectively executing "python/setup.py". This is required to allow PIP installation from a git repo, which assumes that "setup.py" is at the root. e.g.: pip install 'git+http://github.mtv.cloudera.com/Starship/cm_api#egg=cm_api-13.0.0'
1 parent 13674eb commit 4323ac5

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

setup.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#! /usr/bin/env python
2+
# Licensed to Cloudera, Inc. under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. Cloudera, Inc. licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
#
19+
# This file is basically a symlink to "python/setup.py" expressed in
20+
# python code. If python executes "setup.py", it will be effectively
21+
# executing "python/setup.py".
22+
# This is required to allow PIP installation from a git repo, which assumes
23+
# that "setup.py" is at the root.
24+
25+
import os.path
26+
import imp
27+
28+
base_dir = os.path.abspath(os.path.split(__file__)[0])
29+
30+
setup = os.path.join(base_dir, "python", "setup.py")
31+
fobj = open(setup)
32+
imp.load_module("__setup2__", fobj, setup, imp.get_suffixes()[3])

0 commit comments

Comments
 (0)