Skip to content

Commit b22709c

Browse files
fix: pipreqs配置源
1 parent 952e782 commit b22709c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

module/python/venv.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
const pipConf = `[global]
18-
index-url = %s
18+
index-url = https://%s/simple/
1919
trusted-host = %s`
2020

2121
type PipdeptreeStruct struct {
@@ -101,7 +101,7 @@ func pipreqs(dir string, projectPath, savePath string, logger *zap.SugaredLogger
101101
logger.Debug(zap.String("pipreqs Path", dir))
102102
logger.Debug(zap.String("pipreqs projectPath", projectPath))
103103
logger.Debug(zap.String("pipreqs savepath", savePath))
104-
cmd := exec.Command("./pipreqs", projectPath, "--savepath", savePath, "--encoding=utf-8", "--ignore=virtual_venv")
104+
cmd := exec.Command("./pipreqs", projectPath, "--savepath", savePath, "--encoding=utf-8", "--ignore=virtual_venv", "--pypi-server=https://pypi.tuna.tsinghua.edu.cn/pypi")
105105
cmd.Dir = dir
106106
stdout, err := cmd.StdoutPipe()
107107
if err != nil {
@@ -259,7 +259,7 @@ func directDependenceSurvival(mod *[]model.DependencyItem, nvMp map[string]strin
259259
exist[i.CompName] = i.CompVersion
260260
}
261261
for k, v := range nvMp {
262-
if _, ok := exist[k]; !ok {
262+
if _, ok := exist[k]; !ok && k != "pip" && k != "pipreqs" && k != "pipdeptree" {
263263
*mod = append(*mod, model.DependencyItem{
264264
Component: model.Component{
265265
CompName: k,

0 commit comments

Comments
 (0)