我想从我们的Azure Devops发布管道发布一个build.whl包到PyPi.org,但是脚本twine upload
一直挂起,没有错误、完成或超时。因此,我们的包的实际上传(非常小)不起作用
这是如何设置的:
trigger:
- master
pr: none
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
architecture: 'x64'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: pip install -r src/requirements.txt
displayName: 'Install requirements'
- script: |
python src/setup.py bdist_wheel
displayName: 'Artifact creation'
- script: python -m pip install --upgrade twine
displayName: 'Install Twine'
- task: TwineAuthenticate@1
inputs:
pythonUploadServiceConnection: 'AzureML PyPi feed'
- script: |
python -m twine upload --config-file $(PYPIRC_PATH) dist/*.whl
displayName: 'Publish to PyPi through Twine'
Authentication Token
指定李>https://upload.pypi.org/legacy
azure-pypi
AzureML PyPi feed
TwineAuthenticate步骤:
Starting: TwineAuthenticate
==============================================================================
Task : Python twine upload authenticate
Description : Authenticate for uploading Python distributions using twine. Add '-r FeedName/EndpointName --config-file $(PYPIRC_PATH)' to your twine upload command. For feeds present in this organization, use the feed name as the repository (-r). Otherwise, use the endpoint name defined in the service connection.
Version : 1.165.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/twine-authenticate
==============================================================================
75c64e89-xxxxxredactedxxxxx exists true
Adding authentication to configuration for registry azure-pypi
Successfully added auth for 0 internal feed and 1 external endpoint.
Finishing: TwineAuthenticate
发布步骤:
Starting: Publish to PyPi through Twine
==============================================================================
Task : Command line
Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version : 2.164.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
python -m twine upload --config-file /home/vsts/work/_temp/twineAuthenticate/Wv8nMR/.pypirc dist/*.whl
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /home/vsts/work/_temp/0d772e31-148f-4e3c-999b-b2a43a02b287.sh
Uploading distributions to https://upload.pypi.org/legacy/
这保持不变超过30分钟,所以我只是取消发布,而不部署包。有什么想法吗
我现在有一个临时解决办法:
我跳过了配置文件的使用,而是执行了以下代码:
在那里,我注意到更多(更好)的异常日志记录,这为我指出了两件事:
基于上述发现,我将yaml代码片段更新为:
但在执行此操作时,我现在在构建中得到以下异常消息:
我还使用CAT命令输出了pypirc文件的内容,该文件的内容如下:
更新的解决方案
因此,安排403的修复方法是使用以下设置将我的服务连接更改为使用“用户名和密码”作为身份验证方法,而不是身份验证令牌:
__token__
在完成这项工作后,一切都按照我想要的方式进行
相关问题 更多 >
编程相关推荐