官术网_书友最值得收藏!

Using local patches and constraint files

The benefit of open-source software is the ability to view and modify source code. If you are working on a project and create a local version of a PyPI module, such as customizing for a project or creating a patch, requirements.txt can be used to override the normal download of the file.

Constraints files are a modification of requirements files that simply indicate what version of a library is installed, but they don't actually control the installation of files.

One example of using a constraints file is when using a local patched version of a PyPI module, for example, ReqFile. Some software packages downloaded from PyPI rely on ReqFile, but other packages don't. Rather than writing a requirements file for every single package from PyPI that depends on ReqFile, a constraints file can be created as a master record and implemented across all Python projects. Any package being installed that requires ReqFile will see the constraints file and install from the local repository, rather than from PyPI.

In this manner, a single file can be used by every developer and it no longer matters what a PyPI package depends on; the correct version will either be pulled down from PyPI, or the local version will be used as needed.

主站蜘蛛池模板: 聂拉木县| 嘉善县| 岐山县| 乌苏市| 沙湾县| 安丘市| 法库县| 拉萨市| 天台县| 买车| 隆回县| 繁峙县| 奉新县| 萨迦县| 松阳县| 吉首市| 阿巴嘎旗| 弋阳县| 高雄市| 平谷区| 象山县| 潮安县| 唐海县| 马关县| 凉城县| 梁平县| 额敏县| 乌拉特前旗| 琼结县| 游戏| 武城县| 禄丰县| 米泉市| 读书| 太原市| 准格尔旗| 绥阳县| 芜湖市| 桑植县| 子长县| 鄂尔多斯市|