Wed, 20 Jan 2021 11:37:03 +0100
reimplemented lasercutter changes
45 | 1 | #!/usr/bin/env python3 |
15 | 2 | |
3 | # This file is part of the Printrun suite. | |
4 | # | |
5 | # Printrun is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation, either version 3 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # Printrun is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with Printrun. If not, see <http://www.gnu.org/licenses/>. | |
17 | ||
45 | 18 | import ast |
19 | import glob | |
20 | from setuptools import setup | |
21 | from setuptools import find_packages | |
22 | ||
15 | 23 | try: |
24 | from Cython.Build import cythonize | |
25 | extensions = cythonize("printrun/gcoder_line.pyx") | |
26 | from Cython.Distutils import build_ext | |
45 | 27 | except ImportError as e: |
28 | print("WARNING: Failed to cythonize: %s" % e) | |
15 | 29 | # Debug helper: uncomment these: |
30 | # import traceback | |
31 | # traceback.print_exc() | |
32 | extensions = None | |
33 | build_ext = None | |
34 | ||
35 | ||
45 | 36 | with open('README.md') as f: |
37 | long_description = f.read() | |
15 | 38 | |
45 | 39 | with open('requirements.txt') as f: |
40 | install_requires = f.readlines() | |
15 | 41 | |
45 | 42 | with open('printrun/printcore.py') as f: |
43 | for line in f.readlines(): | |
44 | if line.startswith("__version__"): | |
45 | __version__ = ast.literal_eval(line.split("=")[1].strip()) | |
46 | ||
15 | 47 | |
45 | 48 | def multiglob(*globs): |
49 | paths = [] | |
50 | for g in globs: | |
51 | paths.extend(glob.glob(g)) | |
52 | return paths | |
15 | 53 | |
54 | ||
45 | 55 | data_files = [ |
56 | ('share/pixmaps', multiglob('*.png')), | |
57 | ('share/applications', multiglob('*.desktop')), | |
58 | ('share/metainfo', multiglob('*.appdata.xml')), | |
59 | ('share/pronterface/images', multiglob('images/*.png', | |
60 | 'images/*.svg')), | |
61 | ] | |
15 | 62 | |
45 | 63 | for locale in glob.glob('locale/*/LC_MESSAGES/'): |
64 | data_files.append((f'share/{locale}', glob.glob(f'{locale}/*.mo'))) | |
65 | ||
15 | 66 | |
45 | 67 | setup( |
68 | name="Printrun", | |
69 | version=__version__, | |
70 | description="Host software for 3D printers", | |
71 | author="Kliment Yanev, Guillaume Seguin and others", | |
72 | long_description=long_description, | |
73 | long_description_content_type="text/markdown", | |
74 | url="http://github.com/kliment/Printrun/", | |
75 | license="GPLv3+", | |
76 | data_files=data_files, | |
77 | packages=find_packages(), | |
78 | scripts=["pronsole.py", "pronterface.py", "plater.py", "printcore.py"], | |
79 | ext_modules=extensions, | |
80 | python_requires=">=3.6", | |
81 | install_requires=install_requires, | |
82 | setup_requires=["Cython"], | |
83 | classifiers=[ | |
84 | "Environment :: X11 Applications :: GTK", | |
85 | "Intended Audience :: End Users/Desktop", | |
86 | "Intended Audience :: Manufacturing", | |
87 | "Intended Audience :: Science/Research", | |
88 | "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", | |
89 | "Operating System :: MacOS :: MacOS X", | |
90 | "Operating System :: Microsoft :: Windows", | |
91 | "Operating System :: POSIX :: Linux", | |
92 | "Programming Language :: Python :: 3 :: Only", | |
93 | "Programming Language :: Python :: 3.6", | |
94 | "Programming Language :: Python :: 3.7", | |
95 | "Programming Language :: Python :: 3.8", | |
96 | "Topic :: Printing", | |
97 | ], | |
98 | zip_safe=False, | |
99 | ) |