[英]Python build puts wrong version number in filenames
When I run python -m build
, the tar
and whl
files that are created use the wrong version of my package in the filenames.当我运行
python -m build
时,创建的tar
和whl
文件在文件名中使用了我的包的错误版本。
Here is my setup.cfg
:这是我的
setup.cfg
:
[metadata]
# This is required for any package to install with a name
name = stockpyl
# Since we are using a "src" layout, we need the following:
[options]
package_dir=
=src
packages=find:
[options.packages.find]
where=src
[bumpver]
current_version = "0.0.1"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
commit = True
tag = True
push = False
[bumpver:file_patterns]
setup.cfg =
current_version = "{version}"
The files created by build
are named stockpyl-0.0.0.tar.gz
and stockpyl-0.0.0-py3-none-any.whl
. build
创建的文件名为stockpyl-0.0.0.tar.gz
和stockpyl-0.0.0-py3-none-any.whl
。 I assumed that build
would grab the version number (0.0.1) from setup.cfg
but it doesn't seem to be.我假设
build
会从setup.cfg
中获取版本号(0.0.1),但似乎不是。 Where does it get the version number from?它从哪里获得版本号? How do I tell it to use the current version?
我如何告诉它使用当前版本?
Fixed by adding通过添加修复
version = 0.0.1
under [metadata]
.在
[metadata]
下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.