如何用麻线将新版本的项目上传到PyPI? [英] How to upload new versions of project to PyPI with twine?

查看:146
本文介绍了如何用麻线将新版本的项目上传到PyPI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将我的Python包上传到PyPI. 但是现在我制作了新版本的程序包,需要上传它. 我尝试取得与第一次上传程序包时相同的进度. 但是给我这个错误:

I've uploaded my Python package to PyPI. But now I made new version of my package and need to upload it. I tried to make same progress which I did when upload the package first time. but give me this error:

HTTPError: 400 Client Error: File already exists. See https://pypi.org/help/#file-name-reuse for url: https://upload.pypi.org/legacy

现在,如何上传新版本而没有任何错误?

Now, how to upload new version without any error?!

推荐答案

PyPI不允许重复使用分发文件名(项目名称+版本号+分发类型).

PyPI does not allow for the reuse of distribution filenames (project name + version number + distribution type).

这确保了给定项目的给定发行版的给定发行版将始终解析为同一文件,并且项目维护者或恶意方不能在一天之内秘密更改(只能将其删除).

This ensures that a given distribution for a given release for a given project will always resolve to the same file, and cannot be surreptitiously changed one day by the projects maintainer or a malicious party (it can only be removed).

您需要将版本号更改为以前未上传到PyPI的版本号.

You will need to change the version number to one that you haven't previously uploaded to PyPI.

您没有提到如何上载发行版,但是如果您使用的是麻线,则也有可能尝试上载先前上载的发行版.要解决此问题,您可以执行以下操作:

You didn't mention how you're uploading the distribution, but if you're using twine, it's also possible you're attempting to upload a previously uploaded distribution. To resolve this, you can do:

$ twine upload --skip-existing dist/*

这篇关于如何用麻线将新版本的项目上传到PyPI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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