-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
99 lines (87 loc) · 3.21 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# ONE TIME -----------------------------------------------------------------------------
#
# in terminal
# # pip install --upgrade setuptools wheel twine
#
# Create account:
# PyPI test: https://test.pypi.org/account/register/
# or PyPI : https://pypi.org/account/register/
#
# EACH TIME -----------------------------------------------------------------------------
#
# Modify version code in "setup.py" (this file)
#
# in python console
# Build (cd to directory where "setup.py" is)
# # import os
# # os.getcwd()
# python3 setup.py sdist bdist_wheel (is this code? It return error)
#
# Upload:
# PyPI test: twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
# or PyPI : twine upload --skip-existing dist/*
#
# INSTALL ------------------------------------------------------------------------------
#
# Local : python setup.py install
# PyPI test: pip install --index-url https://test.pypi.org/simple/ --upgrade enbios
# PyPI : pip install --upgrade enbios
# No PyPI : pip install -e <local path where "setup.py" (this file) is located>
#
from os import path
from setuptools import setup
from pkg_resources import yield_lines
# from distutils.extension import Extension
# from Cython.Build import cythonize
# from Cython.Distutils import build_ext
"""
python3 setup.py sdist bdist_wheel
twine upload --skip-existing dist/*
"""
package_name = 'enbios'
version = '0.70'
def parse_requirements(strs):
"""Yield ``Requirement`` objects for each specification in `strs`
`strs` must be a string, or a (possibly-nested) iterable thereof.
"""
# create a steppable iterator, so we can handle \-continuations
lines = iter(yield_lines(strs))
ret = []
for line in lines:
# Drop comments -- a hash without a space may be in a URL.
if ' #' in line:
line = line[:line.find(' #')]
# If there is a line continuation, drop it, and append the next line.
if line.endswith('\\'):
line = line[:-2].strip()
try:
line += next(lines)
except StopIteration:
return
ret.append(line)
return ret
with open('requirements.txt') as f:
required = f.read().splitlines()
install_reqs = parse_requirements(required)
print(install_reqs)
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name=package_name,
version=version,
install_requires=install_reqs,
packages=['enbios', 'enbios.bin', 'enbios.common', 'enbios.model',
'enbios.input', 'enbios.input.data_preparation', 'enbios.input.simulators',
'enbios.visualize',
'enbios.processing', 'enbios.processing.indicators'],
include_package_data=True,
url='https://github.com/ENVIRO-Module/enviro',
license='MIT',
author=['Rafael Nebot', 'Cristina Madrid'],
author_email='[email protected]',
entry_points={'console_scripts': ['enbios=enbios.bin.script:main']},
long_description=long_description,
long_description_content_type='text/markdown',
description='Indicators of environmental sustainability of energy systems using MuSIASEM and LCA methodologies'
)