Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scan python requirements in ci #873

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ jobs:
pushd auto
cpanm --quiet --installdeps --notest .
popd
- name: auto-install python script dependencies
run: |
pip install pipreqs
./_testing/autoinstall-python-prereqs.zsh
pip install -r pipreqs_scan/requirements.txt
- name: run tests
run: |
./_testing/run-test.zsh
Expand Down
31 changes: 31 additions & 0 deletions _testing/autoinstall-python-prereqs.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/zsh

mkdir -p pipreqs_scan

. ./_testing/_get_files_arr.zsh

echo -n ... >&2

rfl=()
for fn ($filelist) {
if [[ -f $fn ]] {
rfl+=$fn
}
}
if [[ ${#rfl} -gt 0 ]] {
ln -rst pipreqs_scan $rfl
}
pipreqs pipreqs_scan

typeset -A broken_mods
broken_mods=($(perl -MYAML::Tiny=LoadFile -e'print "$_ 1 " for @{LoadFile(+shift)->{pip}{broken_modules}}' _testing/config.yml))

typeset -a sed_del_broken
for mod (${(k)broken_mods}) { sed_del_broken+=(-e '/^'"$mod"'=/d') }

sed -i \
$sed_del_broken \
pipreqs_scan/requirements.txt

exit 0
# vim:set sw=4 et:
Loading