mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
* style: remove necessary imports * style: fix F841 * style: fix F401 * style: fix F811 * style: fix E402 * style: fix E721 * style: fix E722 * style: fix E722 * style: fix F541 * style: ruff format * style: all passed * style: add ruff in deps * style: more ignores in ruff.toml * style: add pre-commit
39 lines
759 B
Python
39 lines
759 B
Python
from pip._internal import main as pipmain
|
|
|
|
|
|
def install(package):
|
|
pipmain(['install', package])
|
|
|
|
|
|
def install_upgrade(package):
|
|
pipmain(
|
|
[
|
|
'install',
|
|
'--upgrade',
|
|
package,
|
|
'-i',
|
|
'https://pypi.tuna.tsinghua.edu.cn/simple',
|
|
'--trusted-host',
|
|
'pypi.tuna.tsinghua.edu.cn',
|
|
]
|
|
)
|
|
|
|
|
|
def run_pip(params: list):
|
|
pipmain(params)
|
|
|
|
|
|
def install_requirements(file, extra_params: list = []):
|
|
pipmain(
|
|
[
|
|
'install',
|
|
'-r',
|
|
file,
|
|
'-i',
|
|
'https://pypi.tuna.tsinghua.edu.cn/simple',
|
|
'--trusted-host',
|
|
'pypi.tuna.tsinghua.edu.cn',
|
|
]
|
|
+ extra_params
|
|
)
|