如何打包发布Python包至私有仓库

如何打包发布Python包至私有仓库 Python 中的库(package)可以分为标准库和三方库,标注库是在安装Python后,默认安装的库,如math,json等。其余的库可以称之为三方库,需要在使用前单独安装。我们经常使用到 pip install <package> 这个命令就是用于安装三方库的。这里我们只需要指定包名即可非常简单的实现三方库的安装。那么包存储在什么地方,我们是从何处下载安装的呢? PyPi​ Pip install 命令支持四种来源的安装: PyPI (and other indexes) VCS 本地项目目录 本地/远程 的 archives Python 安装包教程:https://packaging.python.org/tutorials/installing-packages/#installing-packages 首先,我们介绍下什么是PyPi。PyPi 是The Python Package Index 的缩写,是Python社区用来开发和共享软件的一种软件仓库。 一般如果在使用 pip 安装、搜索第三方Python库的时候,默认使用 Pypi源,若是希望使用其余(私有)的源,可以通过 -i/--index-url指定。 -i, --index-url <url> Base URL of the Python Package Index (default https://pypi.org/simple). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format. 如经常使用 清华Pypi镜像 加速某些包下载时经常使用如下方式...

如何打包发布Python包至私有仓库

SSH应用:ssh隧道

文章来源: https://iguoli.github.io/2018/09/08/OpenSSH-Port-Forwarding.html 以下端口转发命令都可以加上 -f、-N 和 -T 选项,-f 表示让 ssh 进入后台执行命令,-N 表示不执行远程命令,-T 表示不分配终端。 -f Requests ssh to go to background just before command execution. This is useful if ssh is going to ask for passwords or passphrases, but the user wants it in the background. This implies -n. The recommended way to start X11 programs at a remote site is with something like ssh -f host xterm. -N Do not execute a remote command....

SSH应用:ssh隧道