-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
136 lines (107 loc) · 3.56 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020 João Pedro Rodrigues
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Setuptools-based setup/install script for interfacea.
This uses setuptools, the standard python mechanism for installing packages.
After downloading and uncompressing the source code, or cloning it from git,
type the following command:
python setup.py install
As a developer, to test your changes without installing the package please use:
python setup.py develop
"""
#
# Borrows a lot from Biopython's setup.py script
#
from pathlib import Path
from setuptools import setup
from setuptools import Extension
from setuptools.command.install import install
from setuptools.command.build_py import build_py
from setuptools.command.build_ext import build_ext
CURDIR = Path(".")
# Get version from code
def get_version():
"""Read the variable version from interfacea/version.py."""
f = CURDIR / "interfacea" / "version.py"
contents = f.read_text()
version = contents.strip().split()[-1]
return version[1:-1]
# Get long description
def get_long_description():
"""Read the contents of the README file."""
readme = CURDIR / "README.rst"
contents = readme.read_text()
return contents
PACKAGES = [
"interfacea",
"interfacea.core",
]
EXTENSIONS = [
Extension(
"interfacea.geometry.kdtrees",
[str(CURDIR / "interfacea" / "geometry" / "kdtrees.c")],
),
]
REQUIRES = [
"networkx",
"numpy",
]
#
# Install/Build/Test classes
#
class install_library(install): # noqa
def run(self):
"""Run the installation."""
install.run(self)
class build_py_modules(build_py): # noqa
def run(self):
"""Run the build."""
build_py.run(self)
class build_extensions(build_ext): # noqa
def run(self):
"""Run the build."""
build_ext.run(self)
setup(
name="interfacea",
version=get_version(),
author="Joao Rodrigues",
author_email="[email protected]",
url="https://github.com/joaorodrigues/interfacea",
# download_url="", # TODO: add url to release using version string.
description=("Open-source library to analyze protein interfaces"),
long_description=get_long_description(),
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bioinformatics",
"Topic :: Scientific/Engineering :: Computational Biology",
"Topic :: Software Development :: Libraries :: Python Modules",
],
cmdclass={
"install": install_library,
"build_py": build_py_modules,
"build_ext": build_extensions,
},
packages=PACKAGES,
ext_modules=EXTENSIONS,
install_requires=REQUIRES,
python_requires=">3.8",
)