33 Star 192 Fork 65

PaddlePaddle/PaddleX

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 3.75 KB
一键复制 编辑 原始数据 按行查看 历史
Lin Manhui 提交于 2024-10-01 02:26 . [Feat] Add pipeline serving (#2077)
# copyright (c) 2024 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import glob
import itertools
from pathlib import Path
from setuptools import find_packages
from setuptools import setup
def readme():
"""get readme"""
with open("README.md", "r", encoding="utf-8") as file:
return file.read()
def dependencies():
"""get dependencies"""
with open("requirements.txt", "r") as file:
return file.read()
def version():
"""get version"""
with open(os.path.join("paddlex", ".version"), "r") as file:
return file.read().rstrip()
def packages_and_package_data():
"""get packages and package_data"""
def _recursively_find(pattern, exts=None):
for dir_ in glob.iglob(pattern):
for root, _, files in os.walk(dir_):
for f in files:
if exts is not None:
ext = os.path.splitext(f)[1]
if ext not in exts:
continue
yield os.path.join(root, f)
pkgs = find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"])
pkg_data = []
for p in itertools.chain(
_recursively_find("paddlex/configs/*", exts=[".yml", ".yaml"]),
):
if Path(p).suffix in (".pyc", ".pyo"):
continue
pkg_data.append(Path(p).relative_to("paddlex").as_posix())
pipeline_config = [
Path(p).relative_to("paddlex").as_posix()
for p in glob.glob("paddlex/pipelines/*.yaml")
]
pkg_data.append("inference/pipelines/ppchatocrv3/ch_prompt.yaml")
pkg_data.extend(pipeline_config)
pkg_data.append(".version")
pkg_data.append("utils/fonts/PingFang-SC-Regular.ttf")
pkg_data.append("repo_manager/requirements.txt")
return pkgs, {"paddlex": pkg_data}
if __name__ == "__main__":
pkgs, pkg_data = packages_and_package_data()
s = setup(
name="paddlex",
version=version(),
description=("Low-code development tool based on PaddlePaddle."),
long_description=readme(),
author="PaddlePaddle Authors",
author_email="",
install_requires=dependencies(),
packages=pkgs,
package_data=pkg_data,
entry_points={
"console_scripts": [
"paddlex = paddlex.__main__:console_entry",
],
},
# PyPI package information
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
],
license="Apache 2.0",
keywords=["paddlepaddle"],
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/paddlepaddle/PaddleX.git
git@gitee.com:paddlepaddle/PaddleX.git
paddlepaddle
PaddleX
PaddleX
release/3.0-beta2

搜索帮助