This repository has been archived by the owner on Feb 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·60 lines (53 loc) · 1.54 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
51
52
53
54
55
56
57
58
59
60
from __future__ import print_function
from setuptools import setup, find_packages
import subprocess
Version = "0.1.0"
p = subprocess.Popen(
("git",
"describe",
"--tags"),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
descr = p.stdout.readlines()[0].decode("utf-8").strip()
Version = "-".join(descr.split("-")[:-2])
if Version == "":
Version = descr
except Exception as err:
print("Error:", err)
descr = Version
p = subprocess.Popen(
("git",
"log",
"-n1",
"--pretty=short"),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
commit = p.stdout.readlines()[0].split()[1]
except:
commit = ""
f = open("click_plots/version.py", "w")
print("__version__ = '%s'" % Version, file=f)
print("__git_tag_describe__ = '%s'" % descr, file=f)
print("__git_sha1__ = '{}'".format(commit.decode("utf-8")), file=f)
f.close()
packages = find_packages()
scripts = ['modal/generate_modal.py']
data_files = [
('share/click_plots/js', ['share/js/modal.js', 'share/js/toggle_image.js']),
('share/click_plots', ['share/template_top.json',
'share/template_bottom.json', 'share/nodata.png',
'share/template_one.json', 'share/missing.png'] ),
]
setup(name='click_plots',
version=descr,
author='PCMDI',
description='tools to click on plots',
url='http://github.com/PCMDI/click',
packages=packages,
scripts=scripts,
data_files=data_files
)