diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-31 16:35:33 +0000 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-03-31 16:35:33 +0000 |
| commit | fec5e888a10f6d6c0a64d17242d293fc9da6d3d2 (patch) | |
| tree | 92e14683798648106e573555ed4a97658dfb7122 /config | |
| parent | d0ff10b6ae1075a13827e00dd0120fac9639fde8 (diff) | |
| parent | 67e1de7e57a843622a824f68e4ffb40d8b9ff320 (diff) | |
Merge branch '199059-setup-py' into 'master'v3.3.0
Use virtualenv and pip-licenses to scan python projects
See merge request gitlab-org/security-products/license-management!128
Diffstat (limited to 'config')
| -rw-r--r-- | config/.bashrc | 13 | ||||
| -rw-r--r-- | config/.config/virtualenv/virtualenv.ini | 4 | ||||
| -rw-r--r-- | config/.default-gems | 2 | ||||
| -rw-r--r-- | config/.default-python-packages | 2 | ||||
| -rw-r--r-- | config/install.sh | 5 |
5 files changed, 20 insertions, 6 deletions
diff --git a/config/.bashrc b/config/.bashrc index e85ae56..e883436 100644 --- a/config/.bashrc +++ b/config/.bashrc @@ -3,8 +3,8 @@ alias nuget='mono /usr/local/bin/nuget.exe' function inflate() { - file=$1 - to_dir=$2 + local file=$1 + local to_dir=$2 if [ -f "$file" ]; then echo "Inflating $file in $to_dir" tar --use-compress-program zstd -xf "$file" -C "$to_dir" @@ -13,12 +13,17 @@ function inflate() { } function switch_to() { - tool=$1 - major_version=$2 + local tool=$1 + local major_version=$2 + local version version="$(grep "$tool" "$HOME/.tool-versions"| tr ' ' '\n' | grep "^$major_version")" asdf shell "$tool" "$version" } +function major_version_from() { + echo "$1" | cut -d'.' -f1 +} + function enable_dev_mode() { unset HISTFILESIZE unset HISTSIZE diff --git a/config/.config/virtualenv/virtualenv.ini b/config/.config/virtualenv/virtualenv.ini new file mode 100644 index 0000000..208c7bf --- /dev/null +++ b/config/.config/virtualenv/virtualenv.ini @@ -0,0 +1,4 @@ +[virtualenv] +python = /opt/asdf/shims/python +activators = + bash diff --git a/config/.default-gems b/config/.default-gems index 1c3a508..6870122 100644 --- a/config/.default-gems +++ b/config/.default-gems @@ -1,4 +1,4 @@ bundler ~>1.7 bundler ~>2.0 license_finder ~>6.0.0 -spandx ~>1.0 +spandx ~>0.1 diff --git a/config/.default-python-packages b/config/.default-python-packages index ddef412..86cadc4 100644 --- a/config/.default-python-packages +++ b/config/.default-python-packages @@ -1,3 +1,3 @@ conan pip -pip-licenses +virtualenv diff --git a/config/install.sh b/config/install.sh index 0a0ddf2..f015620 100644 --- a/config/install.sh +++ b/config/install.sh @@ -97,6 +97,11 @@ asdf install asdf reshim asdf current +for version in $(asdf list python); do + asdf shell python "$version" + pip download -d "$HOME/.config/virtualenv/app-data" pip-licenses pip setuptools wheel +done + rm -fr /tmp mkdir -p /tmp chmod 777 /tmp |
