-
Notifications
You must be signed in to change notification settings - Fork 27
/
setup.py
66 lines (55 loc) · 1.78 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
import codecs
import distutils.sysconfig
import distutils.version
import os.path
from setuptools import setup, find_packages, Extension
import numpy as np
with open("README.md", "r") as fh:
long_description = fh.read()
_graph = Extension(
"pymde.preprocess._graph",
sources=["pymde/preprocess/_graph.pyx"],
# once Cython 3.0 is released, uncomment the below line
# define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
extra_compile_args=["-O3"],
include_dirs=[np.get_include()],
)
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), "r") as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
setup(
name="pymde",
version=get_version("pymde/__init__.py"),
description="Minimum-Distortion Embedding",
long_description=long_description,
long_description_content_type="text/markdown",
setup_requires=["setuptools>=18.0", "cython"],
install_requires=[
"matplotlib",
"numpy >= 1.17.5",
"pynndescent",
"scipy",
"torch >= 1.7.1",
"torchvision >= 0.8.2",
# torchvision requires requests but does not list it as a dependency
"requests",
],
packages=find_packages(),
ext_modules=[_graph],
license="Apache License, Version 2.0",
license_files=["LICENSE"],
url="https://github.com/cvxgrp/pymde",
classifiers=[
"Programming Language :: Python :: 3",
],
author="Akshay Agrawal",
author_email="akshayka@cs.stanford.edu",
)