虚拟环境的api。
venvctrl的Python项目详细描述
python与虚拟环境交互的api。
为什么?
虚拟环境提供的唯一真正接口是cli。这个 包包装命令行工具以提供更友好的编程 接口。
创建一个VenV
fromvenvctrlimportapiapi.VirtualEnvironment('/some/path/here').create()
安装软件包
fromvenvctrlimportapivenv=api.VirtualEnvironment('/some/existing/venv')ifnotvenv.has_package('venvctrl'):venv.install_package('venvctrl')else:venv.uninstall_package('venvctrl')
移动通风阀
fromvenvctrlimportapivenv=api.VirtualEnvironment('/some/existing/venv')venv.move('/some/new/path')
或者,使用cli。
venvctrl-relocate \ --source=/some/existing/venv \ --destination=/some/new/path \ --move
许可证
(MIT License) Copyright (C) 2015 Kevin Conway Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
贡献
本项目的所有捐款均受以下协议的保护: 贡献文件。所有贡献者都应该阅读协议,但是 摘要:
You give us the rights to maintain and distribute your code and we promise to maintain an open source distribution of anything you contribute.