forked from QuantumElephant/Flik
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
executable file
·75 lines (55 loc) · 2.02 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# An experimental local optimization package
# Copyright (C) 2018 Ayers Lab <ayers@mcmaster.ca>
#
# This file is part of Flik.
#
# Flik is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# Flik is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>
"""Flik setup script.
If you are not familiar with setup.py, just use pip instead:
pip install Flik --user --upgrade
Alternatively, you can install from source with
./setup.py install --user
"""
from __future__ import print_function
import sys
from warnings import warn
from setuptools import setup
def get_version():
"""Load the version from version.py, without importing it.
This function assumes that the last line in the file contains a variable
defining the version string with single quotes.
"""
with open('flik/version.py', 'r') as f:
return f.read().split('=')[-1].replace('\'', '').strip()
def readme():
"""Load README.rst for display on PyPI."""
with open('README.rst') as f:
return f.read()
if __name__ == '__main__':
if sys.version_info.major == 2:
warn('Python 2 is being used; Flik is only built for Python 3.')
setup(
name='flik',
version=get_version(),
description='An experimental local optimization package',
long_description=readme(),
author='Ayers Lab',
author_email='ayers@mcmaster.ca',
url='https://github.com/QuantumElephant/Flik',
packages=['flik', 'flik.test'],
zip_safe=False,
)