Skip to content

Commit

Permalink
Update CI and project tools (#13)
Browse files Browse the repository at this point in the history
* Update CI and project tools

* remove commented code
  • Loading branch information
maxlou05 authored Aug 29, 2024
1 parent 59145f9 commit 6fd8332
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow will install Python dependencies and run tests with PyTest using Python 3.11
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# For more information see: https://docs.github.com/en/actions/about-github-actions

name: Run tests

Expand All @@ -15,25 +15,30 @@ jobs:

steps:
# Checkout repository
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

# Set Python version
- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

# Set up submodules and submodule dependencies
# TODO: Uncomment when there are submodules
# - name: Set up submodule and submodule dependencies
# run: |
# git submodule update --init --recursive --remote
# pip install -r ./modules/common/requirements.txt
# Upgrade pip
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
# Set up submodules
- name: Set up all submodules and project dependencies
run: |
git submodule foreach --recursive "pip install -r requirements.txt"
# Install project dependencies
- name: Install project dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Run linters and formatters
Expand All @@ -42,8 +47,3 @@ jobs:
black --check .
flake8 .
pylint .
# Run unit tests with PyTest
# TODO: Uncomment when there are unit tests to run
# - name: Run unit tests
# run: pytest -vv
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ venv/
logs/

# Pytorch and Ultralytics
runs/
*.pt
*.pth
21 changes: 21 additions & 0 deletions setup_project.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Initialize the project for Windows

# Activate venv to prevent accidentally installing into global space
./venv/Scripts/Activate.ps1

if($?) {
# If successfully activated venv
"Installing project dependencies..."
pip install -r requirements.txt

""
"Installing submodules and their dependencies..."
git submodule update --init --remote --recursive
git submodule foreach --recursive "pip install -r requirements.txt"

deactivate
""
"Seutp complete!"
} else {
"Please install a virtual environment in the directory 'venv', at the project root directory"
}
22 changes: 22 additions & 0 deletions setup_project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Initialize and update submodules script for Linux

# Activate venv to prevent accidentally installing into global space
source ./venv/bin/activate

if [ $? -eq 0 ]; then
echo "Installing project dependencies..."
pip install -r requirements.txt

echo ""
echo "Installing submodules and their dependencies..."
git submodule update --init --remote --recursive
git submodule foreach --recursive "pip install -r requirements.txt"

deactivate
echo ""
echo "Setup complete!"
else
echo "Please install a virtual environment in the directory 'venv', at the project root directory"
fi

0 comments on commit 6fd8332

Please sign in to comment.