-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Install | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
install: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [macos-latest, ubuntu-latest] | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run the install script | ||
run: | | ||
curl -sSL "https://raw.githubusercontent.com/hhamud/dasy/main/scripts/install.sh" | bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Ape stuff | ||
.build/ | ||
.cache/ | ||
|
||
# Python | ||
.env | ||
.venv | ||
.pytest_cache | ||
.python-version | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
|
||
set -e | ||
|
||
# Constants | ||
PYTHON_VERSION="3.10" # Use Python v3.10 | ||
|
||
# Function to check if a command exists | ||
command_exists() { | ||
command -v "$1" &>/dev/null | ||
} | ||
|
||
# Function to install Python v3.11 if not already installed | ||
install_python() { | ||
if ! command_exists python$PYTHON_VERSION; then | ||
echo "Python is not installed. Installing Python v$PYTHON_VERSION..." | ||
if [[ "$(uname)" == "Linux" ]]; then | ||
sudo apt-get update | ||
sudo apt-get install -y python$PYTHON_VERSION | ||
elif [[ "$(uname)" == "Darwin" ]]; then | ||
# Install Python using Homebrew | ||
brew install python@$PYTHON_VERSION | ||
export PATH="/usr/local/opt/python@$PYTHON_VERSION/bin:$PATH" | ||
else | ||
echo "The shell script is not suitable for Windows." | ||
exit 1 | ||
fi | ||
else | ||
echo "Python is already installed." | ||
fi | ||
} | ||
|
||
# Function to install eth-ape using Poetry | ||
install_eth_ape() { | ||
echo "Installing eth-ape..." | ||
python$PYTHON_VERSION -m pip install --upgrade pip | ||
pip install --user eth-ape | ||
} | ||
|
||
# Function to install APE-Dasy using Poetry | ||
install_ape_dasy() { | ||
echo "Installing APE-Dasy..." | ||
python$PYTHON_VERSION -m pip install --upgrade pip | ||
pip install --user ape-dasy | ||
} | ||
|
||
# Main script | ||
main() { | ||
# Install Python v3.11 (if not already installed) | ||
install_python | ||
|
||
# Install eth-ape using Poetry | ||
install_eth_ape | ||
|
||
# Install APE-Dasy using Poetry | ||
install_ape_dasy | ||
|
||
echo "Setup complete. eth-ape and APE-Dasy have been installed." | ||
} | ||
|
||
# Run the main script | ||
main |