-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
58 lines (47 loc) · 1.48 KB
/
setup.py
File metadata and controls
58 lines (47 loc) · 1.48 KB
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
from pathlib import Path
import subprocess
from distutils.command.build import build
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
def build_lib():
command = ['cc', '-shared', '-fPIC', '-ltiff', 'synthraw/dng.c', '-o', 'synthraw/dng.so']
print('Executing:', ' '.join(command))
subprocess.check_call(command)
class CustomBuild(build):
def run(self):
build_lib()
build.run(self)
class CustomDevelop(develop):
def run(self):
build_lib()
develop.run(self)
class CustomInstall(install):
def run(self):
build_lib()
install.run(self)
setup(name='synthraw',
version='0.1',
description='Synthesizes camera raw files.',
long_description=(Path(__file__).resolve().parent / 'README.rst').read_text(),
url='https://github.com/crowsonkb/synthraw',
author='Katherine Crowson',
author_email='crowsonkb@gmail.com',
license='MIT',
packages=['synthraw'],
install_requires=['numpy>=1.14.3',
'pillow>=5.1.0',
'typing-extensions>=3.6.5'],
package_data={
'synthraw': ['dng.so'],
},
include_package_data=True,
zip_safe=False,
entry_points={
'console_scripts': ['synthraw=synthraw.cli:main'],
},
cmdclass={
'build': CustomBuild,
'develop': CustomDevelop,
'install': CustomInstall,
})