srikanth | 116e6e8 | 2014-08-19 07:22:37 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2013 Big Switch Networks, Inc. |
| 3 | # |
| 4 | # Licensed under the Eclipse Public License, Version 1.0 (the |
| 5 | # "License"); you may not use this file except in compliance with the |
| 6 | # License. You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.eclipse.org/legal/epl-v10.html |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 | # implied. See the License for the specific language governing |
| 14 | # permissions and limitations under the License. |
| 15 | # |
| 16 | |
| 17 | import setuptools, os |
| 18 | import sys |
| 19 | |
| 20 | os.environ['DJANGO_SETTINGS_MODULE'] = 'sdncon.settings' |
| 21 | |
| 22 | def find_files(dirs): |
| 23 | files = [] |
| 24 | for dir in dirs: |
| 25 | l = len(os.path.join(*os.path.split(dir)[:-1])) + 1 |
| 26 | for dirpath, dirnames, filenames in os.walk(dir): |
| 27 | for fn in filenames: |
| 28 | files.append(os.path.join(dirpath, fn)[l:]) |
| 29 | return files |
| 30 | |
| 31 | want_smoke = False |
| 32 | |
| 33 | if sys.argv[-1] == '--smoke-tests-only': |
| 34 | want_smoke = True |
| 35 | del sys.argv[-1] |
| 36 | |
| 37 | setuptools.setup( |
| 38 | name="sdncon", |
| 39 | version="0.1.0", |
| 40 | package_dir={"sdncon": "."}, |
| 41 | packages=["sdncon", "sdncon.controller", "sdncon.rest", |
| 42 | "sdncon.clusterAdmin", "sdncon.coreui", "sdncon.coreui.templatetags", |
| 43 | "sdncon.stats", "sdncon.stats_metadata", |
| 44 | "sdncon.statdropd", "sdncon.syncd", |
| 45 | "sdncon.apps.cstats", "sdncon.apps.logs", |
| 46 | "sdncon.apps.docs", |
| 47 | ], |
| 48 | package_data={"sdncon.coreui": find_files(["coreui/templates", "coreui/img", "coreui/static"]), |
| 49 | "sdncon.clusterAdmin": find_files(["clusterAdmin/templates"]), |
| 50 | "sdncon.apps.cstats": find_files(["apps/cstats/templates", "apps/cstats/img", "apps/cstats/static"]), |
| 51 | "sdncon.apps.logs": find_files(["apps/logs/templates", "apps/logs/img", "apps/logs/static"]), |
| 52 | "sdncon.apps.docs": find_files(["apps/docs/templates", "apps/docs/static"]), |
| 53 | }, |
| 54 | test_suite= "sdncon.runtests.runtests_smoke" if want_smoke \ |
| 55 | else "sdncon.runtests.runtests" |
| 56 | ) |