Skip to content

Commit

Permalink
Integrating automation files from PR #26
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorGilg committed Dec 26, 2024
1 parent d00832d commit d40b991
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 48 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,25 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
options: "--check --verbose"
src: "./"
src: "./CircuitPy"
version: ~= 24.4
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: |
pytest CircuitPy/FC_Board/tests
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,3 @@ repos:
rev: 24.4.2
hooks:
- id: black

#- repo: local
# hooks:
# - id: run-pytest
# name: Run pytest
# entry: pytest Tests/unit_tests/test_detumble.py
# language: system
# types: [python]
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"CircuitPy"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: fmt
fmt:
black .

.PHONY: test
test:
pytest CircuitPy/FC_Board/tests
44 changes: 14 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# flight_controller_software

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
![CI](https://github.com/texas-state-space-lab/pikvm-tailscale-certificate-renewer/actions/workflows/ci.yaml/badge.svg)

Software for the flight controller board in the PROVES Kit. We recent updated this to reflect the impending PROVES Kit V2. In that version of the kit we have both software in Circuit Python and C++ using the PicoSDK. The file tree has been updated to reflect this. Please access either the **CircuitPy (for Circuit Python software)** or **PicoSDK (For C++ Software)** as needed!

Also check out the [development software repo](https://github.com/proveskit/development_software) for our latest experimental software!
Expand All @@ -18,33 +14,9 @@ For CircuitPython load new software by doing the following:
import storage
storage.erase_filesystem()
```
4. The target board will now disappear and remount. Once remounted, copy and paste the contents of the flight software folder for the target board from your GitHub repo.
5. When the new files are onboard you can verify that all the hardware on the board is working properly by opening a serial connection and typing one of the two following commands:

__For Flight Controller Board__
```py
from pysquared import cubesat as c
```
__For Battery Board__
```py
from pysquared_eps import cubesat as c
```

# Development Getting Started
We welcome contributions so please feel free to join us. If you have any questions about contributing please open an issue or a discussion.

We have a few python tools to make development safer, easier, and more consistent. To get started you'll need to set up your python virtual environment (venv).

1. Create your venv `python3 -m venv venv`
2. Activate your venv `source ./venv/bin/activate`
3. Install required packages `pip install -r requirements.txt`
4. The target board will now disappear and remount. Once remounted copy and paste the contents of the flight software folder for the target board from your GitHub repo.

## Precommit hooks
Everytime you make a change in git, it's called a commit. We have a tool called a precommit hook that will run before you make each commit to ensure your code is safe and formatted correctly. To install the precommit hook:

1. Install the precommit hook with `pre-commit install`

## General Structure:
# General Structure:
- **boot.py** This is the code that runs on boot and initializes the stack limit
- **cdh.py** This is the code that handles all the commands. A majority of this code is pulled from the cdh file developed by Max Holliday at Stanford.
- **code.py** This code runs the main operating system of the satellite and handles errors on a high level allowing the system to be fault tolerant
Expand Down Expand Up @@ -75,3 +47,15 @@ This software contains all of the libraries required to operate the sensors, pys
- **pysquared_rfm9x.py** This is a library that implements all the radio hardware. This code is a modified version of the pycubed_rfm9x which is a modified version of the adafruit_rfm9x file.
## tests
This software is used for performing tests on the satellite

## Linting setup

1. Create your venv `python3 -m venv venv`
2. Activate your venv `source ./venv/bin/activate`
3. Install required packages `pip install -r requirements.txt`
4. Run the automatic formatter with `make fmt`

## Testing setup

1. Follow the steps to set up your venv and install packages in the linting setup
2. Run tests with `make test`
12 changes: 4 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
black==24.4.2
cfgv==3.4.0
click==8.1.7
distlib==0.3.8
filelock==3.15.4
identify==2.6.0
exceptiongroup==1.2.2
iniconfig==2.0.0
mypy-extensions==1.0.0
nodeenv==1.9.1
packaging==24.1
pathspec==0.12.1
platformdirs==4.2.2
pre-commit==3.8.0
PyYAML==6.0.1
pluggy==1.5.0
pytest==8.3.2
tomli==2.0.1
typing_extensions==4.12.2
virtualenv==20.26.3

0 comments on commit d40b991

Please sign in to comment.