-
Notifications
You must be signed in to change notification settings - Fork 14
/
setup.py
144 lines (127 loc) · 4.25 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
137
138
139
140
141
142
143
144
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
from setuptools.extension import Extension
from Cython.Build import cythonize
# load __version__ without importing anything
version_file = os.path.join(
os.path.dirname(__file__),
'pyslm/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])
# minimal requirements for installing PySLM
# note that `pip` requires setuptools itself
requirements_default = set([
'numpy', # all data structures
'scipy',
'scikit-image',
'setuptools', # used for packaging
'shapely',
'cython',
'Rtree',
'networkx',
'matplotlib',
'trimesh'
])
# "easy" requirements should install without compiling
# anything on Windows, Linux, and Mac, for Python 2.7-3.4+
requirements_easy = set([
'setuptools', # do setuptools stuff
'shapely',
'Rtree',
'scikit-image',
'networkx',
'trimesh', # Required for meshing geometry
'triangle',
'colorlog']) # log in pretty colors
requirements_supports = set([
'setuptools', # do setuptools stuff
'shapely',
'Rtree',
'scikit-image',
'networkx',
'trimesh', # Required for meshing geometry
'triangle',
'vispy',
'pycork'
'PyQt5',
'mapbox-earcut'
'colorlog']) # log in pretty colors
# requirements for building documentation
# Note API is only read from pyclipper in external project
requirements_docs = set([
'sphinx',
'jupyter',
'sphinx_rtd_theme',
'sphinx-paramlinks'
'pypandoc',
'autodocsumm',
'numpy',
'shapely',
'scipy',
'scikit-image'
'pyclipper',
'networkx',
'trimesh',
'cython'])
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
ext = Extension("pyclipper",
sources=["external/pyclipper/pyclipper.pyx", "external/pyclipper/clipper.cpp"],
language="c++",
# define extra macro definitions that are used by clipper
#la Available definitions that can be used with pyclipper:
# use_lines, use_int32
# See pyclipper/clipper.hpp
define_macros=[('use_lines', 1),
('use_xyz', 1)]
)
extB = Extension("pyslm.pyclipper",
sources=["external/pyclipper/pyclipper.cpp", "external/pyclipper/clipper.cpp"],
language="c++",
# define extra macro definitions that are used by clipper
# Available definitions that can be used with pyclipper:
# use_lines, use_int32
# See pyclipper/clipper.hpp
define_macros=[('use_lines', 1),
('use_xyz', 1)]
)
setup(
name='PythonSLM',
version=__version__,
description='Python Package for Additive Manufacturing Development',
long_description=readme,
long_description_content_type='text/x-rst',
author='Luke Parry',
author_email='dev@lukeparry.uk',
url='https://github.com/drlukeparry/pyslm',
keywords=['3D Printing', 'AM', 'Additive Manufacturing', 'Geometry', 'SLM', 'Selective Laser Melting'],
ext_modules=cythonize([ext, extB]),
setup_requires=[
'cython>=0.28'
],
python_requires='>=3.5',
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Natural Language :: English',
'Topic :: Scientific/Engineering'],
license="",
packages=find_packages(exclude=('tests', 'docs', 'examples')),
install_requires=list(requirements_default),
extras_require={'easy': list(requirements_easy),
'support': list(requirements_supports),
'docs': list(requirements_docs)},
project_urls = {
'Documentation': 'https://pyslm.readthedocs.io/en/latest/',
'Source': 'https://github.com/drylukeparry/pyslm/pyslm/',
'Tracker': 'https://github.com/drlukeparry/pyslm/issues'
}
)