PyPIPublisher@0 - PyPI 发布者 v0 任务
使用此任务,使用 Twine 创建 sdist 或 wheel 并将其上传到与 PyPI 兼容的索引。
语法
# PyPI publisher v0
# Create and upload an sdist or wheel to a PyPI-compatible index using Twine.
- task: PyPIPublisher@0
inputs:
pypiConnection: # string. Alias: serviceEndpoint. Required. PyPI service connection.
packageDirectory: # string. Alias: wd. Required. Python package directory.
#alsoPublishWheel: false # boolean. Alias: wheel. Also publish a wheel. Default: false.
输入
pypiConnection
-
PyPI 服务连接
输入别名:serviceEndpoint
。
string
。 必填。
指定用于连接到包索引的通用服务连接。
packageDirectory
-
Python 包目录
输入别名:wd
。
string
。 必填。
指定在 setup.py
所在的创建和发布的 Python 包的目录。
alsoPublishWheel
-
还发布轮
输入别名:wheel
。
boolean
。 默认值:false
。
指定除了 sdist 包之外,是否创建和发布通用滚轮包(独立于平台)。 有关 打包 Python 项目的详细信息,。
任务控制选项
除任务输入之外,所有任务都具有控制选项。 有关详细信息,请参阅 控件选项和常见任务属性。
输出变量
没有。
注解
重要
PyPI 发布服务器任务已弃用。 现在可以 使用孪生身份验证和自定义脚本发布 PyPI 包。
使用此任务,使用 Twine 创建 sdist 或 wheel 并将其上传到与 PyPI 兼容的索引。
此任务通过在 PATH
中使用 Python 实例运行 python setup.py sdist
来生成 sdist 包。 除了 sdist,它还可以选择生成通用轮。 它将使用 twine
将包上传到 PyPI 索引。
该任务将使用 python -m pip install --user
安装 wheel
和 twine
包。