-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
48 lines (43 loc) · 1.5 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import find_packages, setup
packages = find_packages('python')
scripts = ['bin/casa_distro']
here = os.path.abspath(os.path.dirname(__file__))
release_info = {}
with open(os.path.join(here, 'python', 'casa_distro', 'info.py')) as f:
code = f.read()
exec(code, release_info)
# Parse share directory to add extra data files in a directory
# that can be automatically found during casa_distro startup
distro_dir = os.path.join(here, 'share', 'distro')
data_files = []
for base, dirs, files in os.walk(distro_dir):
if files:
# data_files.extend(os.path.join(base[len(here)+1:],i) for i in files)
data_files.append([
os.path.join(
'lib', 'python%d.%d' % sys.version_info[:2],
'site-packages', 'casa_distro',
'share', 'distro',
base[len(distro_dir) + 1:]
),
[os.path.join(base[len(here) + 1:], i) for i in files]
])
# from pprint import pprint
# pprint(data_files)
setup(
name=release_info['NAME'],
description=release_info['DESCRIPTION'],
long_description=release_info['LONG_DESCRIPTION'],
license=release_info['LICENSE'],
author=release_info['AUTHOR'],
author_email=release_info['AUTHOR_EMAIL'],
version=release_info["__version__"],
package_dir={'': 'python'},
packages=packages,
data_files=data_files,
scripts=scripts,
install_requires=[], # we do not want casa-distro to have dependencies
)