Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Infra] Use pyproject.toml instead of setup.cfg #294

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Bobholamovic
Copy link
Member

PEP 621开始,pyproject.toml已经成为现代Python配置项目元信息的标准方式。目前ERNIE SDK中各项目尚未完全跟进PEP 621,而是采用强依赖于setuptools的“历史遗留”方式:setup.pysetup.cfgpyproject.toml共同存在,pyproject.toml仅用于配置formatter和linter。

本PR将SDK中各项目的项目元信息配置方式进行“现代化”,统一为PEP 621鼓励的方式。

Comment on lines -20 to -24
git_version: Optional[str]
try:
git_version = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii").strip()
except (OSError, subprocess.CalledProcessError):
git_version = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个在打包的时候会把 git 信息打包进去吗?如果会的话,那 pyproject.toml 如何试下这个功能呢?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个目前应该是完全没有用,我们也没有用到setuptools-scm等能够记录git版本号的工具~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants