Skip to content

Commit

Permalink
Merge pull request #873 from ailin-nemui/pyscan
Browse files Browse the repository at this point in the history
scan python requirements in ci
  • Loading branch information
ailin-nemui authored Jan 30, 2024
2 parents 9dfa2fb + ef03dbf commit ee0a5b3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
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:

0 comments on commit ee0a5b3

Please sign in to comment.