Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
ec51cd8e
Commit
ec51cd8e
authored
Mar 01, 2024
by
赵小蒙
Browse files
setup.py从requirements.txt获取依赖
parent
1bbab881
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
setup.py
setup.py
+20
-18
No files found.
setup.py
View file @
ec51cd8e
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
def
parse_requirements
(
filename
):
with
open
(
filename
)
as
f
:
lines
=
f
.
read
().
splitlines
()
requires
=
[]
for
line
in
lines
:
if
"http"
in
line
:
pkg_name_with_version
=
line
.
split
(
'/'
)[
-
1
].
split
(
'-'
)[
0
]
requires
.
append
(
pkg_name_with_version
)
else
:
requires
.
append
(
line
)
return
requires
requires
=
parse_requirements
(
'requirements.txt'
)
setup
(
setup
(
name
=
"magic_pdf"
,
# 项目名
name
=
"magic_pdf"
,
# 项目名
version
=
"0.1.0"
,
# 版本号
version
=
"0.1.0"
,
# 版本号
packages
=
find_packages
(),
# 包含所有的包
packages
=
find_packages
(),
# 包含所有的包
install_requires
=
[
'PyMuPDF>=1.23.25'
,
install_requires
=
requires
,
# 项目依赖的第三方库
'boto3>=1.34.52'
,
'botocore>=1.34.52'
,
'Brotli>=1.1.0'
,
'click>=8.1.7'
,
'Distance>=0.1.3'
,
'loguru>=0.7.2'
,
'matplotlib>=3.8.3'
,
'numpy>=1.26.4'
,
'pandas>=2.2.1'
,
'pycld2>=0.41'
,
'regex>=2023.12.25'
,
'spacy>=3.7.4'
,
'termcolor>=2.4.0'
,
'en_core_web_sm>=3.7.1'
,
'zh_core_web_sm>=3.7.0'
,
],
# 项目依赖的第三方库
python_requires
=
">=3.9"
,
# 项目依赖的 Python 版本
python_requires
=
">=3.9"
,
# 项目依赖的 Python 版本
# entry_points={"console_scripts": ["my_command=my_project.main:run"]}, # 项目提供的可执行命令
# entry_points={"console_scripts": ["my_command=my_project.main:run"]}, # 项目提供的可执行命令
include_package_data
=
True
,
# 是否包含非代码文件,如数据文件、配置文件等
include_package_data
=
True
,
# 是否包含非代码文件,如数据文件、配置文件等
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment