whitesource / unified-agent-distribution

51 stars 48 forks source link

pipenv lock -r: Error: No such option: -r #49

Open pnowy opened 10 months ago

pnowy commented 10 months ago

When we try to scan Python code with Mend Java agent (release v23.7.1) and Pipenv we get the following error:

[WARN] [2023-08-07 16:20:39,771 +0000] - Command - executeProcess - error in execute command 'pipenv lock -r', Exit Status 2
[WARN] [2023-08-07 16:20:39,772 +0000] - Read error line #1: Usage: pipenv lock [OPTIONS]
[WARN] [2023-08-07 16:20:39,772 +0000] - Read error line #2: Try 'pipenv lock -h' for help.
[WARN] [2023-08-07 16:20:39,772 +0000] - Read error line #3: Error: No such option: -r
[ERROR] [2023-08-07 16:20:39,772 +0000] - Error occurred while running command pipenv lock -r in /home/jenkins/agent/workspace/...

It seems that the agent under the hood using the old syntax of pipenv which is not available anymore.

Is there any way to handle/configure the option to avoid that kind of issue?

hamdrew commented 8 months ago

A workaround is to generate the requirements.txt file manually and remove Pipenv files:

      - name: "Install pipenv"
        run: pip install --user pipenv

      - name: "Generate requirements.txt"
        run: pipenv requirements --dev > requirements.txt

      # Mend is broken with pipenv - https://github.com/whitesource/unified-agent-distribution/issues/49
      - name: "Remove pipenv files"
        run: rm -rf Pipfile Pipfile.lock .venv
alumni commented 5 months ago

I arrived here since I noticed WhiteSource is not scanning correctly. Any plans to have this fixed?