-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
50 lines (43 loc) · 1.45 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
49
50
#!/usr/bin/env python
import glob
import os
from setuptools import find_packages, setup
# Get some values from the setup.cfg
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
conf = ConfigParser()
conf.read(['setup.cfg'])
metadata = dict(conf.items('metadata'))
# Metadata
PACKAGENAME = metadata.get('package_name', 'src')
DESCRIPTION = metadata.get('description', 'Repository for creating ECO synthetic catalogues using Conditional Abundance Matching (CAM)')
AUTHOR = metadata.get('author', 'Victor Calderon and Duncan Campbell')
AUTHOR_EMAIL = metadata.get('author_email', '[email protected]')
LICENSE = metadata.get('license', 'unknown')
VERSION = metadata.get('version', '0.0.0dev')
URL = metadata.get('url', '')
# Long Description
readme_glob = 'README*'
_cfg_long_description = metadata.get('long_description', '')
if _cfg_long_description:
LONG_DESCRIPTION = _cfg_long_description
elif os.path.exists('LONG_DESCRIPTION.rst'):
with open('LONG_DESCRIPTION.rst') as f:
LONG_DESCRIPTION = f.read()
elif len(glob.glob(readme_glob)) > 0:
with open(glob.glob(readme_glob)[0]) as f:
LONG_DESCRIPTION = f.read()
else:
LONG_DESCRIPTION = ''
setup(
name=PACKAGENAME,
version=VERSION,
packages=find_packages(),
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
license=LICENSE,
url=URL)