forked from mikedh/trimesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
103 lines (96 loc) · 4.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
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
#!/usr/bin/env python
import os
import sys
from setuptools import setup
# load __version__ without importing anything
version_file = 'trimesh/version.py'
with open(version_file, 'r') as f:
# use eval to get a clean string of version from file
__version__ = eval(f.read().strip().split('=')[-1])
# load README.md as long_description
long_description = ''
if os.path.exists('README.md'):
with open('README.md', 'r') as f:
long_description = f.read()
# "easy" requirements should install without compiling
# anything on Windows, Linux, and Mac, for Python 2.7-3.4+
requirements_easy = set([
'scipy', # provide convex hulls, fast graph ops, etc
'networkx', # provide slow graph ops with a nice API
'lxml', # handle XML better and faster than built- in XML
'pyglet', # render preview windows nicely
'shapely', # handle 2D polygons robustly
'rtree', # create N- dimension trees for broad- phase queries
'svg.path', # handle SVG format path strings
'sympy', # do analytical math
'msgpack', # serialize into msgpack
'pillow', # load images
'requests', # do network requests
'xxhash', # hash ndarrays faster than built-in MD5/CRC
'setuptools', # do setuptools stuff
'pycollada', # parse collada/dae/zae files
'chardet', # figure out if someone used UTF-16
'colorlog']) # log in pretty colors
# `lxml` removed Python 3.4 support in version 4.4.0
# cap `lxml` at the last version that did support Python 3.4
# we could also do this with very confusing PEP508 rules:
# https://www.python.org/dev/peps/pep-0508/#environment-markers
if sys.version_info.major == 3 and sys.version_info.minor == 4:
# remove raw `lxml` requirement
requirements_easy.difference_update('lxml')
# replace it with version locked `lxml`
requirements_easy.add('lxml<=4.3.5')
# "all" requirements only need to be installable
# through some mechanism on Linux with Python 3.5+
# and are allowed to compile code
requirements_all = requirements_easy.union([
'triangle', # 2D triangulations of polygons
'python-fcl', # do fast 3D collision queries
'psutil', # figure out how much memory we have
'glooey', # make GUI applications with 3D stuff
'scikit-image']) # marching cubes and other nice stuff
# call the magical setuptools setup
setup(name='trimesh',
version=__version__,
description='Import, export, process, analyze and view triangular meshes.',
long_description=long_description,
long_description_content_type='text/markdown',
author='Michael Dawson-Haggerty',
author_email='[email protected]',
license='MIT',
url='https://github.com/mikedh/trimesh',
keywords='graphics mesh geometry 3D',
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Natural Language :: English',
'Topic :: Scientific/Engineering'],
packages=[
'trimesh',
'trimesh.ray',
'trimesh.path',
'trimesh.path.exchange',
'trimesh.scene',
'trimesh.voxel',
'trimesh.visual',
'trimesh.viewer',
'trimesh.exchange',
'trimesh.resources',
'trimesh.interfaces'],
package_data={'trimesh': ['resources/*.template',
'resources/*.json']},
install_requires=['numpy'],
extras_require={'test': ['pytest',
'pytest-cov',
'pyinstrument',
'coveralls'],
'easy': list(requirements_easy),
'all': list(requirements_all)}
)