Skip to content

Conversation

@swgu98
Copy link
Contributor

@swgu98 swgu98 commented Nov 8, 2025

PR Category

Environment Adaptation

PR Types

Others

Description

修改手动编包和nightly包默认情况读取version.txt指定版本并添加日期后缀,需要每次拉新版本分支后更新version.txt文件
若不想采用这种格式,可在编包前指定环境变量PADDLE_VERSION为自己想要的版本,比如0.0.0
流水线除distribute仍保留0.0.0格式
pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Nov 8, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

# Print the last commit date
message(STATUS "Last commit date: ${DATE_ONLY}")
if(NOT PADDLE_VERSION)
set(PADDLE_VERSION "dev${DATE_ONLY}")
Copy link
Member

Choose a reason for hiding this comment

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

为什么不能基于文件管理?

https://github.com/pytorch/pytorch/blob/main/version.txt

这是不符合版本号规范的 https://peps.python.org/pep-0440/

Copy link
Member

Choose a reason for hiding this comment

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

只需对之前逻辑略作修改,伪码如下

def get_paddle_version():
    if has_env("PADDLE_VERSION"):
        return get_env("PADDLE_VERSION")  # release version
    default_version = read_from_file(f"{project_root}/version.txt")
    default_version.endswith(".dev")
    date_suffix = get_date_from_last_commit()
    version = default_version + date_suffix
    return version  # develop version

每次拉分支时更新源分支版本号,这可以通过 GitHub Actions 来自动完成

Copy link
Contributor Author

Choose a reason for hiding this comment

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

读version.txt文件加到cmake里了

@swgu98 swgu98 changed the title version Modify the version variable in manual package assembly Nov 8, 2025
@swgu98 swgu98 changed the title Modify the version variable in manual package assembly Modify the paddle.__version__ in manual package assembly Nov 8, 2025
@SigureMo SigureMo changed the title Modify the paddle.__version__ in manual package assembly Refactor version management to use version.txt with date suffix for nightly builds Nov 8, 2025
@SigureMo SigureMo changed the title Refactor version management to use version.txt with date suffix for nightly builds Refactor version management to use version.txt with date suffix for nightly builds Nov 8, 2025
@SigureMo SigureMo changed the title Refactor version management to use version.txt with date suffix for nightly builds Refactor version management to use version.txt with date suffix for develop builds Nov 8, 2025
SigureMo
SigureMo previously approved these changes Nov 8, 2025
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

@SigureMo
Copy link
Member

SigureMo commented Nov 8, 2025

image

流水线除distribute仍保留0.0.0格式

distribute 为啥不保留呀

@swgu98
Copy link
Contributor Author

swgu98 commented Nov 8, 2025

image > 流水线除distribute仍保留0.0.0格式

distribute 为啥不保留呀

因为这个PR目的就是让paddle.__version__能比3.2大,让formers流水线不挂

CCACHE_DIR: /root/.ccache/formers
CFS_DIR: /home/data/cfs
paddle_whl: /workspace/dist/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
paddle_whl: /workspace/dist/*.whl
Copy link
Member

Choose a reason for hiding this comment

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

诶?这样容易有 bug 吧?paddlepaddle_gpu*.whl 可以么?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

一样的吧,这个目录就只有一个whl包

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我不管我不管,xpu过了先合🐶

Copy link
Member

Choose a reason for hiding this comment

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

可以先合,后面改一下

@SigureMo SigureMo merged commit 0091f01 into PaddlePaddle:develop Nov 9, 2025
72 of 75 checks passed
@swgu98 swgu98 deleted the dev-version branch November 9, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants