mirror of
https://github.com/googleapis/googleapis.git
synced 2026-08-14 12:42:59 +02:00
- modify python versions. see https://github.com/googleapis/gapic-generator/pull/3128 - use markdown readme instead of rst - remove enum34 - fix namespace google.cloud -> google.maps. see https://github.com/googleapis/gapic-generator/issues/3166 PiperOrigin-RevId: 305773355
43 lines
1.2 KiB
Bash
Executable file
43 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
# Performs Maps specific post-processing on a .tar.gz archive
|
|
|
|
use_map_namespace() {
|
|
f="${1}/setup.py"
|
|
sed -e "s/google.cloud/google.maps/g" "${f}" > "${f}.new" && mv "${f}.new" "${f}"
|
|
}
|
|
|
|
use_markdown_readme() {
|
|
f="${1}/setup.py"
|
|
sed -e "s/README.rst/README.md/g" "${f}" > "${f}.new" && mv "${f}.new" "${f}"
|
|
rm -f "${1}/README.rst"
|
|
}
|
|
|
|
update_python_versions() {
|
|
f="${1}/setup.py"
|
|
sed -e "/Python :: 2/d" "${f}" > "${f}.new" && mv "${f}.new" "${f}"
|
|
sed -e "/Python :: 3.4/d" "${f}" > "${f}.new" && mv "${f}.new" "${f}"
|
|
sed -e "/enum34/d" "${f}" > "${f}.new" && mv "${f}.new" "${f}"
|
|
sed -e "s/'Programming Language :: Python :: 3.6',/'Programming Language :: Python :: 3.6',\n 'Programming Language :: Python :: 3.7',/g" "${f}" > "${f}.new" && mv "${f}.new" "${f}"
|
|
}
|
|
|
|
# Main entry point
|
|
#
|
|
# Arguments:
|
|
# postprocess_dir: The directory that contains the Java files to postprocess.
|
|
main() {
|
|
postprocess_dir="$1"
|
|
|
|
if [ "${postprocess_dir}" = "" ]; then
|
|
echo "postprocess_dir is required"
|
|
exit 1
|
|
fi
|
|
|
|
use_markdown_readme "${postprocess_dir}"
|
|
update_python_versions "${postprocess_dir}"
|
|
use_map_namespace "${postprocess_dir}"
|
|
}
|
|
|
|
main "$@"
|