Most of the time, you will want to publish your packages on PyPI.
大多数时候,您需要把自己的包发布到Py PI上。
Next, go to PyPI and register for an account (don't worry: it's free).
接下来,访问 PyPI并注册一个账号(不用担心,它是免费的)。
Notice that the first pip installation downloaded and installed from PyPI.
注意,第一个pip安装是从 PyPI下载和安装的。
The contents of the file should contain your PyPI credentials, as shown in Listing 1.
该文件的内容应该包含您的Py PI证书,如清单1中所示。
The next two commands are chained together: sdist upload builds a source distribution, and then uploads it to PyPI.
接下来的两个命令是串连在一起使用的:sdist upload 构造了一个源发布,然后将它上传到 PyPI。
A common method for publishing packages to PyPI (or your own distribution server) is to create a source distribution to upload.
将包发布到Py PI(或者您自己的发布服务器)上的一种常用方法是创建一个源发布并上传。
This file populates the landing page on PyPI, so it's a good idea to briefly describe the project and show examples of usage in this file.
此文件用于填充py PI上的登录页面,因此在文件中简要描述项目并显示一些使用实例是个好主意。
By publishing your package on the Python package Index (PyPI), you'll make it easily accessible through utilities like PIP or easy_install.
如果在PythonPackageIndex (PyPI)上发布您的包,那么就可以通过像pip或easy_install这样的实用工具轻易地对其进行访问。
Finally, as PIP and virtualenv gain wider adoption, reliance on published packages-whether on PyPI or on your own distribution servers-increases.
最后,由于pip与virtualenv赢得了更为广泛的采用,对发布包的依赖(位于Py pi或您自己的发布服务器上)越来越大。
Now, in writing your setup.py script, you have to decide what you want displayed on the PyPI index page, and what do you want to name your project.
在编写setup .py脚本时,您必须决定要在py PI索引页面上显示什么内容,以及您想给项目取什么名称。
The NAME is what people will refer to your software as, the name under which your software is listed in PyPI and—more importantly—under which users will install it (for example, pip install NAME).
NAME就是人们引用您的软件时使用的名称,这个软件名称将会列在 PyPI 中,而且更重要的是,用户将使用这个名称来安装软件(例如,pip 安装 NAME)。
The NAME is what people will refer to your software as, the name under which your software is listed in PyPI and—more importantly—under which users will install it (for example, pip install NAME).
NAME就是人们引用您的软件时使用的名称,这个软件名称将会列在 PyPI 中,而且更重要的是,用户将使用这个名称来安装软件(例如,pip 安装 NAME)。
应用推荐