使用麻线将包上传到 pypi:无效的 URI [英] Uploading package to pypi using twine: Invalid URI

查看:51
本文介绍了使用麻线将包上传到 pypi:无效的 URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了官方文档 用于将包上传到 PyPI,以及 PyPI 自述文件中提供的信息,但我每次都收到 HTTP 400 错误:

I followed the official documentation for uploading packages to PyPI, as well as the information provided in PyPI readme, but I get a HTTP 400 error each time:

$ twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy
Enter your username: Sinistag
Enter your password:
Uploading paulla.check_dns_sync-0.1.dev0.py3-none-any.whl
HTTPError: 400 Client Error: home_page: Invalid URI for url: https://upload.pypi.org/legacy

这是怎么回事?

推荐答案

问题出在 setup.py

Invalid URI 表示 setup() 函数中的 url 字段不是有效的 url.例如,它应该类似于 url="https://github.com/namespace/repo"

Invalid URI means the url field in the setup() function is not a valid url. It should be something like url="https://github.com/namespace/repo" for example

这是包代码的url,新的pypi repo不接受url错误的包.

This is the url to the package code, and the new pypi repo doesn't accept package with wrong url.

在 twine 的 repo 上查看 这个问题

see this issue on twine's repo

这篇关于使用麻线将包上传到 pypi:无效的 URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆