Adjust shell scripts to use root of repo

This commit is contained in:
Michael Hansen 2022-03-30 14:45:12 -04:00
commit 9b0065deb8
6 changed files with 27 additions and 46 deletions

View file

@ -26,8 +26,15 @@ echo 'Installing Python dependencies'
pip3 ${PIP_INSTALL} --upgrade pip
pip3 ${PIP_INSTALL} --upgrade wheel setuptools
find "${this_dir}" -name 'requirements*.txt' -type f -print0 | \
xargs -0 -n1 pip3 ${PIP_INSTALL} -r
# Install Mimic 3
pip3 ${PIP_INSTALL} -e "${this_dir}/opentts-abc"
# Include support for languages besides English
pushd "${this_dir}/mimic3-tts" 2>/dev/null
pip3 ${PIP_INSTALL} -e '.[de,fr,it,nl,ru,sw]'
popd 2>/dev/null
pip3 ${PIP_INSTALL} -e "${this_dir}/mimic3-http"
# -----------------------------------------------------------------------------

View file

@ -6,15 +6,14 @@ this_dir="$( cd "$( dirname "$0" )" && pwd )"
# Kebab to snake case
module_name="$(basename "${this_dir}" | sed -e 's/-/_/g')"
src_dir="${this_dir}/${module_name}"
base_dir="$(realpath "${this_dir}/..")"
# Path to virtual environment
: "${venv:=${this_dir}/.venv}"
: "${venv:=${base_dir}/.venv}"
if [ -d "${venv}" ]; then
# Activate virtual environment if available
source "${venv}/bin/activate"
fi
export PYTHONPATH="${this_dir}"
python3 -m "${module_name}" "$@"

View file

@ -6,15 +6,14 @@ this_dir="$( cd "$( dirname "$0" )" && pwd )"
# Kebab to snake case
module_name="$(basename "${this_dir}" | sed -e 's/-/_/g')"
src_dir="${this_dir}/${module_name}"
base_dir="$(realpath "${this_dir}/..")"
# Path to virtual environment
: "${venv:=${this_dir}/.venv}"
: "${venv:=${base_dir}/.venv}"
if [ -d "${venv}" ]; then
# Activate virtual environment if available
source "${venv}/bin/activate"
fi
export PYTHONPATH="${this_dir}"
python3 -m "${module_name}.download" "$@"

View file

@ -1,34 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
# Path to virtual environment
: "${venv:=${this_dir}/.venv}"
# Python binary to use
: "${PYTHON=python3}"
# pip install command
: "${PIP_INSTALL=install}"
python_version="$(${PYTHON} --version)"
# Create virtual environment
echo "Creating virtual environment at ${venv} (${python_version})"
rm -rf "${venv}"
"${PYTHON}" -m venv "${venv}"
source "${venv}/bin/activate"
# Install Python dependencies
echo 'Installing Python dependencies'
pip3 ${PIP_INSTALL} --upgrade pip
pip3 ${PIP_INSTALL} --upgrade wheel setuptools
find "${this_dir}" -name 'requirements*.txt' -type f -print0 | \
xargs -0 -n1 pip3 ${PIP_INSTALL} -r
# -----------------------------------------------------------------------------
echo "OK"

View file

@ -6,15 +6,14 @@ this_dir="$( cd "$( dirname "$0" )" && pwd )"
# Kebab to snake case
module_name="$(basename "${this_dir}" | sed -e 's/-/_/g')"
src_dir="${this_dir}/${module_name}"
base_dir="$(realpath "${this_dir}/..")"
# Path to virtual environment
: "${venv:=${this_dir}/.venv}"
: "${venv:=${base_dir}/.venv}"
if [ -d "${venv}" ]; then
# Activate virtual environment if available
source "${venv}/bin/activate"
fi
export PYTHONPATH="${this_dir}"
python3 -m "${module_name}" "$@"

View file

@ -14,6 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from collections import defaultdict
from pathlib import Path
import setuptools
@ -59,6 +60,16 @@ for lang in [
]:
extras[f"gruut[{lang}]"] = [lang]
# Add "all" tag
for tags in extras.values():
tags.append("all")
# Invert for setup
extras_require = defaultdict(list)
for dep, tags in extras.items():
for tag in tags:
extras_require[tag].append(dep)
# -----------------------------------------------------------------------------
setup(
@ -72,7 +83,7 @@ setup(
packages=setuptools.find_packages(),
package_data={"mimic3_tts": ["VERSION", "py.typed"]},
install_requires=requirements,
extras_require={':python_version<"3.9"': ["importlib_resources"], **extras},
extras_require={':python_version<"3.9"': ["importlib_resources"], **extras_require},
entry_points={"console_scripts": ["mimic3 = mimic3_cli.__main__:main"]},
classifiers=[
"Development Status :: 3 - Alpha",