Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to python 3.11 #47

Merged
merged 10 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will install Python dependencies and run tests with PyTest using Python 3.8
# 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

name: Run tests
Expand All @@ -19,10 +19,10 @@ jobs:
uses: actions/checkout@v3

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

# Set up submodules
- name: Set up all submodules and project dependencies
Expand All @@ -34,6 +34,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
git submodule foreach --recursive "pip install -r requirements.txt"

# Install zbar library to resolve pyzbar import error
- name: Install zbar library
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "mavlink/dronekit"]
path = mavlink/dronekit
url = https://github.com/UWARG/dronekit.git
branch = WARG-minimal
1 change: 1 addition & 0 deletions mavlink/dronekit
Submodule dronekit added at 319248
2 changes: 1 addition & 1 deletion mavlink/modules/flight_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time

import dronekit
from .. import dronekit

from . import drone_odometry

Expand Down
2 changes: 1 addition & 1 deletion mavlink/test_mission_ended.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time

import dronekit
from mavlink import dronekit

from mavlink.modules import flight_controller

Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ ignore-paths = [

# Logging
"logs/",

# Submodule dronekit
"mavlink/dronekit",
]

# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
Expand All @@ -24,7 +27,7 @@ jobs = 0

# Minimum Python version to use for version dependent checks. Will default to the
# version used to run pylint.
py-version = "3.8"
py-version = "3.11"

# Discover python modules and packages in the file system subtree.
recursive = true
Expand Down Expand Up @@ -99,4 +102,7 @@ minversion = "6.0"

[tool.black]
line-length = 100
target-version = ["py38"]
target-version = ["py311"]
# Excludes files or directories in addition to the defaults
# Submodules
extend-exclude = "mavlink/dronekit/*"
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ numpy
# Module lte
Pillow

# Module mavlink
dronekit

# Module qr
pyzbar

Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ extend-exclude=

# Logging
logs/,

# Submodule dronekit
mavlink/dronekit,
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we deactivate the venv after installing dependencies?

""
"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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

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