forked from joshlk/k-means-constrained
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
70 lines (56 loc) · 2.33 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
"""
To build pip tar:
`python setup.py sdist`
To compile cython (better to use the compile_cython.py script):
`python setup.py build_ext`
Based on template: https://github.com/pypa/sampleproject/blob/master/setup.py
"""
from setuptools import setup, find_packages
from pip.req import parse_requirements
from codecs import open # To use a consistent encoding
from os import path
from Cython.Build import cythonize
import numpy as np
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = parse_requirements('requirements.txt', session=False)
# Profile cython and output html with annotation
cython_options = {"compiler_directives": {"profile": True}, "annotate": True}
setup(
name='k_means_constrained',
version='0.2.0',
description='K-Means clustering constrained with minimum and maximum cluster size',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/outrauk/k_means_constrained',
author='Josh Levy-Kramer @ Outra',
author_email='josh@outra.co.uk',
keywords='kmeans k-means minimum maximum cluster segmentation size',
packages=find_packages(),
install_requires=[str(e.req) for e in install_requires],
# Classifiers help users find your project by categorizing it.
#
# For a list of valid classifiers, see
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[ # Optional
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 4 - Beta',
# Indicate who your project is intended for
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering',
# Pick your license as you wish
'License :: OSI Approved :: BSD License',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
# For cython
ext_modules=cythonize("k_means_constrained/mincostflow_vectorized_.pyx", **cython_options),
include_dirs=[np.get_include()]
)