-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathsetup.py
More file actions
84 lines (68 loc) · 2.38 KB
/
setup.py
File metadata and controls
84 lines (68 loc) · 2.38 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
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
import os
import sys
import textwrap
import pipcl
VERSION = '1.27.2.2'
VERSION_TUPLE = tuple(int(x) for x in VERSION.split("."))
# We build with, and run with, a particular PyMuPDF version usually, but not
# always, the same as our version.
#
pymupdf_version = VERSION
# We build with, and run with, a particular pymupdf_layout version usually, but
# not always, the same as our version.
#
pymupdf_layout_version = VERSION
PYMUPDF_SETUP_VERSION = os.environ.get('PYMUPDF_SETUP_VERSION')
if PYMUPDF_SETUP_VERSION:
# Allow testing with non-matching pymupdf/layout versions.
requires_dist = ["tabulate"]
else:
requires_dist = [
f"pymupdf=={pymupdf_version}",
f"pymupdf_layout=={pymupdf_layout_version}",
"tabulate",
]
def build():
ret = list()
version_info = textwrap.dedent(f'''
# Generated file - do not edit.
{VERSION=}
{VERSION_TUPLE=}
''')
ret.append((version_info.encode('utf-8'), 'pymupdf4llm/versions_file.py'))
for p in pipcl.git_items('src'):
ret.append((f'src/{p}', f'pymupdf4llm/{p}'))
print(f'ret:')
for i in ret:
print(f' {i}')
return ret
p = pipcl.Package(
'pymupdf4llm',
VERSION,
requires_dist=requires_dist,
requires_python='>=3.10',
pure=True,
author="Artifex",
author_email="support@artifex.com",
summary='PyMuPDF Utilities for LLM/RAG',
description='README.md',
description_content_type='text/markdown',
classifier = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
],
license = 'Dual Licensed - GNU AFFERO GPL 3.0 or Artifex Commercial License',
project_url = [
'Documentation, https://pymupdf.readthedocs.io/',
'Source, https://github.com/pymupdf/pymupdf4llm',
'Tracker, https://github.com/pymupdf/PyMuPDF/issues',
'Changelog, https://pymupdf.readthedocs.io/en/latest/changes.html',
],
fn_build = build,
)
build_wheel = p.build_wheel
if __name__ == '__main__':
p.handle_argv(sys.argv)