Merge pull request #335 from Rewrite0/3.1-venv

feat: use venv
This commit is contained in:
Estrella Pan
2023-06-15 10:35:00 +08:00
committed by GitHub

View File

@@ -1,27 +1,28 @@
#!/bin/bash
# This script is used to run the development environment.
python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple install -r requirements-dev.txt
python3 -m venv venv
./venv/bin/python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple install -r requirements-dev.txt
# install git-hooks for pre-commit before committing.
pre-commit install
./venv/bin/pre-commit install
cd src || exit
CONFIG_DIR="config"
if [ ! -d "$CONFIG_DIR" ]; then
echo "The directory '$CONFIG_DIR' is missing."
mkdir config
echo "The directory '$CONFIG_DIR' is missing."
mkdir config
fi
VERSION_FILE="module/__version__.py"
if [ ! -f "$VERSION_FILE" ]; then
echo "The file '$VERSION_FILE' is missing."
echo "VERSION='DEV_VERSION'" >> "$VERSION_FILE"
echo "The file '$VERSION_FILE' is missing."
echo "VERSION='DEV_VERSION'" >>"$VERSION_FILE"
fi
python3 main.py
../venv/bin/python3 main.py