diff --git a/erniebot-agent/pyproject.toml b/erniebot-agent/pyproject.toml index 421acf6c..72fa55dd 100644 --- a/erniebot-agent/pyproject.toml +++ b/erniebot-agent/pyproject.toml @@ -1,7 +1,44 @@ +[build-system] +requires = ["setuptools >= 61.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "erniebot-agent" +description = "Python library for the ERNIE Bot Agent" +classifiers = ["Programming Language :: Python"] +requires-python = ">=3.8" +dynamic = ["version", "dependencies"] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.optional-dependencies] +gradio = ["gradio >= 3.48"] +all = [ + "erniebot_agent[gradio]", +] + +[tool.setuptools] +package-dir = {"" = "src"} +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] +include = [ + "erniebot_agent", + "erniebot_agent.*", +] +namespaces = true + +[tool.setuptools.dynamic] +version = {attr = "erniebot_agent.version.VERSION"} +dependencies = {file = ["requirements.txt"]} + [tool.isort] -profile = 'black' -src_paths = ['src', 'tests'] +profile = "black" +src_paths = ["src", "tests"] [tool.black] line-length = 109 -target_version = ['py38', 'py39', 'py310'] +target_version = ["py38", "py39", "py310"] diff --git a/erniebot-agent/setup.cfg b/erniebot-agent/setup.cfg deleted file mode 100644 index 5c8545bb..00000000 --- a/erniebot-agent/setup.cfg +++ /dev/null @@ -1,47 +0,0 @@ -# Here's a link about setup.cfg: -# https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files -[metadata] -name = erniebot-agent -version = attr: erniebot_agent.version.VERSION -description = Python library for the ERNIE Bot Agent -long_description = file: README.md -long_description_content_type = text/markdown -classifier = - Programming Language :: Python - -[options] -package_dir = - =src -packages = find_namespace: -python_requires = >=3.8 -install_requires = file: requirements.txt -include_package_data = True - -[options.packages.find] -where = src -include = - erniebot_agent - erniebot_agent.* - -[options.entry_points] -console_scripts = - erniebot_agent = erniebot_agent.__main__:console_entry - -[options.extras_require] -gradio = - gradio >= 3.48 -jinja2 = - jinja2 -all = - erniebot_agent[gradio] - erniebot_agent[jinja2] - -[sdist] -dist_dir = output/dist - -[bdist_wheel] -dist_dir = output/dist - -[easy_install] -# Using baidu's official pip source -index_url = http://pip.baidu.com/root/baidu/+simple/ diff --git a/erniebot-agent/setup.py b/erniebot-agent/setup.py deleted file mode 100644 index 39dbc6cc..00000000 --- a/erniebot-agent/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. -# -# 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 subprocess -from typing import Optional - -from setuptools import setup - -git_version: Optional[str] -try: - git_version = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii").strip() -except (OSError, subprocess.CalledProcessError): - git_version = None - -setup() diff --git a/erniebot/pyproject.toml b/erniebot/pyproject.toml index 981e553b..2a42cc04 100644 --- a/erniebot/pyproject.toml +++ b/erniebot/pyproject.toml @@ -1,7 +1,41 @@ +[build-system] +requires = ["setuptools >= 61.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "erniebot" +description = "Python library for the ERNIE Bot" +classifiers = ["Programming Language :: Python"] +requires-python = ">=3.8" +dynamic = ["version", "dependencies"] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.scripts] +erniebot = "erniebot.__main__:console_entry" + +[tool.setuptools] +package-dir = {"" = "src"} +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] +include = [ + "erniebot", + "erniebot.*", +] +namespaces = false + +[tool.setuptools.dynamic] +version = {attr = "erniebot.version.VERSION"} +dependencies = {file = ["requirements.txt"]} + [tool.isort] -profile = 'black' -src_paths = ['src'] +profile = "black" +src_paths = ["src", "tests"] [tool.black] line-length = 109 -target_version = ['py38', 'py39', 'py310'] +target_version = ["py38", "py39", "py310"] diff --git a/erniebot/setup.cfg b/erniebot/setup.cfg deleted file mode 100644 index 63f7b098..00000000 --- a/erniebot/setup.cfg +++ /dev/null @@ -1,42 +0,0 @@ -# Here's a link about setup.cfg: -# https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files - -[metadata] -name = erniebot -version = attr: erniebot.version.VERSION -description = Python library for the ERNIE Bot -long_description = file: README.md -long_description_content_type = text/markdown -classifier = - Programming Language :: Python - -[options] -package_dir = - =src -packages = find: -python_requires = >=3.8 -install_requires = file: requirements.txt -include_package_data = True - -[options.packages.find] -where = src -include = - erniebot - erniebot.* - -[options.entry_points] -console_scripts = - erniebot = erniebot.__main__:console_entry - -[options.extras_require] -docs = file: docs-requirements.txt - -[sdist] -dist_dir = output/dist - -[bdist_wheel] -dist_dir = output/dist - -[easy_install] -# Using baidu's official pip source -index_url = http://pip.baidu.com/root/baidu/+simple/ diff --git a/erniebot/setup.py b/erniebot/setup.py deleted file mode 100644 index 93e5649b..00000000 --- a/erniebot/setup.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. -# -# 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 subprocess -from typing import Optional - -from setuptools import setup - -try: - git_version: Optional[str] = ( - subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii").strip() - ) -except (OSError, subprocess.CalledProcessError): - git_version = None - -setup()