-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
32 lines (23 loc) · 971 Bytes
/
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
#!/usr/bin/env python
from setuptools import setup, find_packages
import os
import pathlib
import configparser
## Create a configuration file for the KPIC DRP if it doesn't exist.
homedir = pathlib.Path.home()
config_filepath = os.path.join(homedir, ".kpicdrp")
if not os.path.exists(config_filepath):
kpicdrp_basedir = os.path.dirname(__file__)
config = configparser.ConfigParser()
config.read(os.path.join(kpicdrp_basedir, ".kpicdrp_template"))
config["PATH"]["caldb"] = kpicdrp_basedir
config["PATH"]["datadir"] = os.path.join(kpicdrp_basedir, "data/")
with open(config_filepath, 'w') as f:
config.write(f)
print("kpicdrp: Configuration file written to {0}. Please edit if you want things stored in different locations.".format(config_filepath))
setup(name='kpicdrp',
version='1.0',
description='KPIC Data Reduction Pipeline',
author='KPIC Team',
packages=find_packages(),
)