Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8391018
pip-ls-deps
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
921 B
Subscribers
None
pip-ls-deps
View Options
#!/bin/bash
LS_MODS
=
"bin/ls-py-modules"
if
!
[
-x
"
$LS_MODS
"
]
;
then
echo
"pip-ls-deps should be run from the root of swh-environment. Bye."
exit
2
fi
for
pymod
in
$(
${
LS_MODS
}
)
;
do
reqs
=
"
${
pymod
}
/requirements.txt"
if
[
-f
"
$reqs
"
]
;
then
cat
"
$reqs
"
fi
done
\
|
egrep
-v
'^#|^[[:blank:]]*$'
\
|
tr
'[:upper:]_'
'[:lower:]-'
\
|
sort
-ru
\
|
awk
'!seen[$1]++'
\
|
tac
# WARNING: CRUDE HACK in the pipeline above. 'pip3 install' will fail if the
# same package name appears multiple times, e.g., as both "django" and "django
# >= 1.10.7" rather than trying to determine (when possible) a comprehensive
# constraint. So we deduplicate here, by first sorting alphabetically which
# will (generally...) put higher dependency constraints last and then
# deduplicate using the sole package name as key. In the example above this
# should only keep "django >= 1.10.7" and get rid of "django".
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Jun 4 2025, 6:37 PM (14 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3312895
Attached To
rDENV Development environment
Event Timeline
Log In to Comment