Compare commits
5 commits
771878775e
...
14aa8def2e
Author | SHA1 | Date | |
---|---|---|---|
14aa8def2e | |||
37277d1dc2 | |||
c271c7de58 | |||
719aa2f9fd | |||
37af0dbe2d |
1 changed files with 52 additions and 40 deletions
92
py.pypi.sh
92
py.pypi.sh
|
@ -41,47 +41,59 @@ tmp="${root}/tmp"
|
||||||
rm --force --recursive \
|
rm --force --recursive \
|
||||||
~/.cache/pip "${root}"
|
~/.cache/pip "${root}"
|
||||||
|
|
||||||
python3 -m pip \
|
for version in "3.10" "3.11" "3.12"; do
|
||||||
download \
|
export VIRTUAL_ENV="/prj/venv/${version}"
|
||||||
--dest "${root}" \
|
export OLD_PATH="${PATH}"
|
||||||
"${@}"
|
export PATH="${VIRTUAL_ENV}/bin:${PATH}"
|
||||||
|
|
||||||
prefix="Name: "
|
sub="${root}/${version}"
|
||||||
for wheel in "${root}/"*; do
|
|
||||||
echo
|
python -m pip \
|
||||||
echo "${wheel}"
|
download \
|
||||||
file="$(basename "${wheel}")"
|
--dest "${sub}" \
|
||||||
case "${file}" in
|
"${@}"
|
||||||
*.tar.gz)
|
|
||||||
short="${file%.*}"
|
prefix="Name: "
|
||||||
short="${short%.*}"
|
for wheel in "${sub}/"*; do
|
||||||
;;
|
rm --force --recursive "${tmp}"
|
||||||
*.whl)
|
echo
|
||||||
short="${file%.*}"
|
echo "${wheel}"
|
||||||
;;
|
file="$(basename "${wheel}")"
|
||||||
esac
|
case "${file}" in
|
||||||
file_name="$(echo "${short}" | cut -d "-" -f 1)"
|
*.tar.gz)
|
||||||
file_version="$(echo "${short}" | cut -d "-" -f 2)"
|
short="${file%.*}"
|
||||||
case "${file}" in
|
short="${short%.*}"
|
||||||
*.tar.gz)
|
;;
|
||||||
meta_data="${file_name}-${file_version}/${file_name}.egg-info/PKG-INFO"
|
*.whl)
|
||||||
tar xf "${wheel}" -C "${tmp}" "${meta_data}"
|
short="${file%.*}"
|
||||||
;;
|
;;
|
||||||
*.whl)
|
esac
|
||||||
meta_data="${file_name}-${file_version}.dist-info/METADATA"
|
file_name="$(echo "${short}" | cut -d "-" -f 1)"
|
||||||
unzip "${wheel}" "${meta_data}" -d "${tmp}"
|
file_version="$(echo "${short}" | cut -d "-" -f 2)"
|
||||||
;;
|
case "${file}" in
|
||||||
esac
|
*.tar.gz)
|
||||||
name="$(grep "${prefix}" "${tmp}/${meta_data}" | sed "s|${prefix}||")"
|
meta_data="${file_name}-${file_version}/${file_name}.egg-info/PKG-INFO"
|
||||||
echo "${name}"
|
tar xf "${wheel}" -C "${tmp}" "${meta_data}"
|
||||||
name="$(echo "${name}" | tr "[:upper:]" "[:lower:]")"
|
;;
|
||||||
name="$(echo "${name}" | tr "." "-")"
|
*.whl)
|
||||||
name="$(echo "${name}" | tr "_" "-")"
|
meta_data="${file_name}-${file_version}.dist-info/METADATA"
|
||||||
name="$(echo "${name}" | tr -d "\r")"
|
unzip "${wheel}" "${meta_data}" -d "${tmp}"
|
||||||
echo "${name}"
|
;;
|
||||||
sub="${root}/simple/${name}"
|
esac
|
||||||
mkdir --parents "${sub}"
|
name="$(grep "${prefix}" "${tmp}/${meta_data}" | sed "s|${prefix}||")"
|
||||||
mv -i "${root}/${file_name}-"* "${sub}/"
|
echo "${name}"
|
||||||
|
name="$(echo "${name}" | tr "[:upper:]" "[:lower:]")"
|
||||||
|
name="$(echo "${name}" | tr "." "-")"
|
||||||
|
name="$(echo "${name}" | tr "_" "-")"
|
||||||
|
name="$(echo "${name}" | tr -d "\r")"
|
||||||
|
echo "${name}"
|
||||||
|
simple="${sub}/simple/${name}"
|
||||||
|
mkdir --parents "${simple}"
|
||||||
|
mv -i "${sub}/${file_name}-"* "${simple}/"
|
||||||
|
done
|
||||||
|
|
||||||
|
export PATH="${OLD_PATH}"
|
||||||
|
unset OLD_PATH VIRTUAL_ENV
|
||||||
done
|
done
|
||||||
|
|
||||||
rm --force --recursive "${tmp}"
|
rm --force --recursive "${tmp}"
|
||||||
|
|
Loading…
Reference in a new issue