-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.sh
executable file
·39 lines (33 loc) · 1.17 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
######################
# CONTRIBUTING SETUP #
######################
# Run this file to set up your environment to contribute to gerrytools.
# You will need to run this from the root of the gerrytools repository.
echo "Making python virtual environment '.venv' in current directory"
python3 -m venv .venv
echo "Environment created"
# Activate the environment for macOS and Linux
if [ "$(uname)" == "Darwin" ] || [ "$(uname)" == "Linux" ]; then
printf "\n\nActivating environment"
source .venv/bin/activate
# Activate the environment for Windows
else
printf "\n\nActivating environment"
source .venv/Scripts/activate
fi
echo "Environment activated"
echo "Updating pip"
pip install -qq --upgrade pip
echo "pip has been updated"
printf "\n\nInstalling requirements from requirements.txt into environment\n"
pip install -qq -r requirements.txt
echo "Done!"
printf "\n\nInstalling working directory's version of gerrytools into environment\n"
pip install -qq -e .
echo "Done!"
printf "\n\nInstalling pre-commit hooks\n"
pip install -qq pre-commit
pre-commit autoupdate
pre-commit install
echo "Done!"
printf "\n\nSetup complete! You are now ready to contribute to gerrytools.\n"