forked from oie-mines-paristech/lca_algebraic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
62 lines (52 loc) · 1.82 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
61
62
import os, sys
from setuptools import setup
import subprocess
from datetime import datetime
import time
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname))\
.read().strip()
def run(args) :
return subprocess.run(args, stdout=subprocess.PIPE).\
stdout.decode('utf-8').splitlines()
# Get current git branch
branches = run(["git", "branch"])
curr_branch = next(line for line in branches if "*" in line)
curr_branch = curr_branch.replace(" ", "").replace("*", "")
version = read("VERSION")
name = "lca_algebraic"
if curr_branch != "master" :
name += "_dev"
#commit = run(["git", "log"])[0].split()[1][0:8]
start = datetime.strptime("2021-01-01", '%Y-%m-%d')
now = datetime.now()
min_diff = int((now-start).total_seconds() // 60)
version += "." + str(min_diff) + "-dev"
setup(
name = name,
version = version,
author = "OIE - Mines ParisTech",
author_email = "[email protected]",
description = ("This library provides a layer above brightway2 for defining parametric models and running super fast LCA for monte carlo analysis."),
license = "BSD",
keywords = "LCA brightway2 monte-carlo parametric",
url = "https://github.com/oie-mines-paristech/lca_algebraic/",
packages=['lca_algebraic'],
long_description=read('README.md'),
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[
'tabulate',
'ipywidgets',
'pandas',
'seaborn',
'sympy',
'matplotlib',
'deprecation',
'brightway2==2.3',
'SALib']
)