Skip to content
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
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Email credentials
SENDER_EMAIL=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
RECEIVER_EMAIL=recipient_email@example.com
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
47 changes: 47 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Pull Request
about: Create a pull request to help us improve
title: ''
labels: ''
assignees: ''

---

## Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Test A
- [ ] Test B

**Test Configuration**:
* Firmware version:
* Hardware:
* Toolchain:
* SDK:

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
5 changes: 5 additions & 0 deletions .github/badges.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# .github/badges.yml
schemaVersion: 1
label: 'contributors'
message: 'Made with :heart:'
color: 'orange'
84 changes: 25 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,38 @@
name: Continuous Integration
name: Python CI

# Controls when the workflow will run
# Triggers on push to the main branch and on pull request targeting the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This job builds the code, runs tests, and lints
build_and_test:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13'] # Support common Python versions
python-version: ["3.9", "3.10", "3.11"]

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v4

# Set up Python environment
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# Install uv (package manager and dependency resolver)
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.uv/bin" >> $GITHUB_PATH

# Install dependencies using uv
- name: Install Dependencies
run: uv pip install --system --all-extras --cache-dir .uv/cache

# Run Ruff for linting and formatting
- name: Lint with Ruff
run: ruff check . --fix
# Note: --fix can be used here, but might require committed changes. Consider a separate format step.

# Run Pytest for unit and integration tests
- name: Test with Pytest
run: pytest --cov=./ --cov-report=xml
# Collect coverage reports for Codecov

# Upload coverage reports for Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # Ensure CODECOV_TOKEN is set in repository secrets
files: ./coverage.xml
fail_ci_if_error: true # Fails the build if Codecov upload fails

# Publish to PyPI if on main branch and is a tagged release
# This is a simplified example; a more robust system might use dedicated publish jobs/steps
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.12'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
uv pip install --system twine
python -m twine upload --repository testpypi dist/* # Use testpypi for testing releases
# python -m twine upload --repository pypi dist/* # Uncomment for actual PyPI upload
# Note: Requires build step before upload to create dist/* files.
# A separate job for 'build' which runs 'python -m build' and then this job can be triggered.
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ruff black isort
- name: Lint with ruff
run: |
ruff .
- name: Format with black
run: |
black --check .
- name: Sort imports with isort
run: |
isort --check-only .
- name: Test with pytest
run: |
pytest
32 changes: 21 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __pycache__/
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
Expand All @@ -29,6 +30,7 @@ MANIFEST
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -70,7 +72,6 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -88,11 +89,22 @@ ipython_config.py
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
# having sub-dependencies with platform-specific dependencies, it may be better to ignore
# Pipfile.lock.
# Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# The same reasoning applies to ignoring it.
# poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
# The same reasoning applies to ignoring it.
# pdm.lock
# .pdm.toml

# PEP 582; used by e.g. pdm
__pypackages__/

# Celery stuff
Expand Down Expand Up @@ -129,13 +141,11 @@ dmypy.json
# Pyre type checker
.pyre/

# pytype static type analyzer
# pytype static analyzer
.pytype/

# Cython debug symbols
cython_debug/


output
dist
secrets.py
# VSCode
.vscode/
Loading
Loading