-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
39 lines (34 loc) · 1.19 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
import os
import stat
from setuptools import setup, find_packages
from setuptools.command.install import install
class OverrideInstall(install):
def run(self):
install.run(self) # calling install.run(self) insures that everything that happened previously still happens, so the installation does not break!
# here we start with doing our overriding and private magic ..
bin_path = os.path.join('pdf_parser', 'bin')
add_mode = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
for filepath in self.get_outputs():
if bin_path in filepath:
# print('filepath', filepath)
st = os.stat(filepath)
os.chmod(filepath, st.st_mode | add_mode)
setup(
name='pdf-parser',
version='1.1.12',
description='This is a multi-backend PDF parser for IIoT.',
author='Shuhao Li & Yuting Jia',
packages=find_packages(),
package_data={
'pdf_parser': [
"bin/pdffigures",
"jar/cermine-1.13.jar",
"jar/pdffigures2-0.1.0.jar",
],
},
install_requires=[
'requests>=2.23.0',
'science-parse-api>=1.0.1'
],
cmdclass={'install': OverrideInstall}
)