-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-deps.sh
More file actions
executable file
·28 lines (24 loc) · 1.07 KB
/
make-deps.sh
File metadata and controls
executable file
·28 lines (24 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
for folder in $(ls -d ${WORKDIR:-${PWD}}/services/* | grep -v __pycache__)
do
if [[ -d ${folder} ]]; then
group=$(basename ${folder})
# check if service group exists (to avoid poetry errors)
poetry show --with=${group} --quiet
group_exists=$?
all_groups=""
if [[ $group_exists -eq 0 ]]; then
# export main dependencies AND specific group dependencies
echo creating requirements in ${folder}
# collect groups to export for testing which requires ALL deps
all_groups="${all_groups} --with=${group}"
poetry export --without-hashes --with=${group} --with main > ${folder}/runtime/requirements.txt
else
# export main only - so get centrally installed dependencies
echo creating requirements in ${folder}
poetry export --without-hashes --with main > ${folder}/runtime/requirements.txt
fi
fi
done
# export for testing
poetry export --without-hashes --with dev $all_groups > ${WORKDIR:-${PWD}}/tests/requirements.txt