Skip to content

Commit

Permalink
support python3.12 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
engshahrad authored Aug 11, 2024
1 parent 7689e25 commit bfd3710
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/automated-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.10.12
python-version: 3.12.3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ GenConfigs.py
__pycache__/
*.coverage

# virtualenv
venv_faasprofiler/

# MacOS DS_Store files
.DS_Store
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ After cloning this repo run the one-time configuration script:
```
bash configure.sh
```
Activate the virtual environment:
```
source venv_faasprofiler/bin/activate
```
You can deactivate the virtual environment at the end by running:
```
deactivate
```

## Usage Guide

Expand Down Expand Up @@ -86,8 +94,8 @@ The [Comparative Analyzer](./comparative_analyzer) module compares the results o

Environment/Tool | Tested Version(s)
---------------- | --------------
Python | 3.8 (fully tested), 3.10 (partially tested)
OS | Ubuntu 16.04.4 LTS, Ubuntu 20.04.1 LTS
Python | 3.8 (fully tested), 3.10 (partially tested), 3.12 (partially tested)
OS | Ubuntu 16.04.4 LTS, Ubuntu 20.04.1 LTS, Ubuntu 24.04 LTS

Python Library | Latest Tested Version
---------------- | --------------
Expand Down
26 changes: 20 additions & 6 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
# Installing basic dependencies if needed
sudo apt-get install -y moreutils

# Check if python3.10 is installed
if ! command -v python3.10 &> /dev/null
# Check if python3.12 is installed
if ! command -v python3.12 &> /dev/null
then
echo "Python 3.10 could not be found. Installing..."
echo "Python 3.12 could not be found. Installing..."
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python3.10
sudo apt-get install -y python3.12
sudo apt install python3.12-venv
else
echo "Python 3.10 is already installed."
echo "Python 3.12 is already installed."
fi

# Check if pip is installed
Expand All @@ -25,8 +26,21 @@ else
echo "Pip is already installed."
fi

# Create a python virtual environment
if [ ! -d "venv_faasprofiler" ]
then
echo "Creating virtual environment..."
python3.12 -m venv venv_faasprofiler
else
echo "Virtual environment already exists."
fi

# Activate the virtual environment
source venv_faasprofiler/bin/activate
echo "Directory data_archive already exists."

# Install python dependencies
python3.10 -m pip install -r requirements.txt
python3.12 -m pip install -r requirements.txt

# Configure path variables used by the platform
ROOTLINE='FAAS_ROOT="'$(echo $PWD)'"'
Expand Down
1 change: 1 addition & 0 deletions tests/unit_tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if [ ! -f "$GenConfigFile" ]; then
fi

cd ../../
source venv_faasprofiler/bin/activate
cp tests/test_data/2021_01_18_04_37_test_data_run.pkl data_archive
python3 -m coverage run -m unittest tests/unit_tests/*_test.py
python3 -m coverage report -m *.py
Expand Down

0 comments on commit bfd3710

Please sign in to comment.