Skip to content

Commit

Permalink
fix: pipreqs配置源
Browse files Browse the repository at this point in the history
  • Loading branch information
reverse-direction-god committed Dec 31, 2024
1 parent 952e782 commit b22709c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/python/venv.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const pipConf = `[global]
index-url = %s
index-url = https://%s/simple/
trusted-host = %s`

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

0 comments on commit b22709c

Please sign in to comment.