-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdateRequirements.py
More file actions
20 lines (17 loc) · 871 Bytes
/
Copy pathupdateRequirements.py
File metadata and controls
20 lines (17 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -*- coding: utf-8 -*-
import shlex, subprocess
# NOTE:
# Use pip freeze when you want to rebuild the same environment, e.g.:
# pip freeze > requirements_venv_as4pgc.txt
# Use pipreqs when you want to document only direct dependencies from your code.
print("Updating requirements.txt..")
# TODO: correct Issue: [B603:subprocess_without_shell_equals_true] subprocess call - check for execution of untrusted input.
# Severity: Low Confidence: High
# Note: with shell=True it's even worse, we get then:
# Issue: [B602:subprocess_popen_with_shell_equals_true] subprocess call with shell=True identified, security issue.
# Severity: High Confidence: High
#########################################
p1 = subprocess.Popen(shlex.split("pipreqs --force ./ --ignore backups --mode compat"), shell=False) # shell=True)
p1.wait()
p1.terminate()
p1.kill()