`twine upload dist/*` 命令有什么作用?

what does `twine upload dist/*` command do?

我提前道歉,因为这似乎是一个基本问题...

我正在尝试学习使用 mujoco(link here),在它的 python 绑定 Makefile 中它有:

upload:
   rm -rf dist
   python setup.py sdist
   twine upload dist/*

twin upload dist/* 命令有什么作用? 此外,这会要求我输入用户名和密码,如下所示:

Uploading distributions to https://pypi.python.org/pypi
Enter your username: guest
Enter your password: 
Uploading mujoco-py-0.5.7.tar.gz
HTTPError: 401 Client Error: You must be identified to edit package information for url: https://pypi.python.org/pypi
Makefile:2: recipe for target 'upload' failed

这是在询问我的计算机用户名和密码吗?

Twine is a commonly used system for uploading project builds to PyPI(Python 包索引)。

它将负责将项目的构建工件以 wheel、sdist 等格式安全地传输到 PyPI 或其他一些用户定义的索引服务器。

当您指定 twine upload <files> 时,twine 将尝试将上述文件上传到 PyPI,但为此,它需要您进行身份验证。这是因为 PyPI 想要保护一个项目免受他们宣传的包 "hijacked" 的影响。为了继续执行此步骤,您必须提供标记为对您上传的项目工件所属的项目具有权威性的凭据。

看起来 mujoco 项目的 Makefile 包含一个目标,可以通过使用 Twine 应用程序轻松将项目更新上传到 PyPI。该目标仅供包维护者使用。

哦,如果您想知道,python setup.py sdist 命令是生成可以上传到 PyPI 的源代码工件的原因。它会将此工件作为 project-name_version.tar.gz.

放置在 ./build/ 目录中