Files
LangBot/pkg/utils/pkgmgr.py
Junyan Qin (Chin) 209f16af76 style: introduce ruff as linter and formatter (#1356)
* 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
2025-04-29 17:24:07 +08:00

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
)