Skip to content

Commit df8be3e

Browse files
committed
Update release documentation, CICD checks
1 parent 39e75a8 commit df8be3e

22 files changed

+1041
-243
lines changed

.coverage

52 KB
Binary file not shown.

.flake8

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
[flake8]
22
max-line-length = 120
3-
extend-ignore = E203
3+
extend-ignore = E203, W503
4+
exclude =
5+
.git,
6+
__pycache__,
7+
.venv,
8+
venv,
9+
build,
10+
dist,
11+
*.egg-info,
12+
.pytest_cache,
13+
.mypy_cache
14+
per-file-ignores =
15+
# Functional tests import after path manipulation
16+
tests/functional/*.py: E402

.github/workflows/test.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
lint:
11+
name: Lint and Type Check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Set up Python 3.11
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.11"
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e ".[dev]"
28+
29+
- name: Run flake8
30+
run: |
31+
python -m flake8 fmd_api/ tests/ --count --show-source --statistics
32+
33+
- name: Run mypy
34+
run: |
35+
python -m mypy fmd_api/
36+
37+
test:
38+
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
39+
runs-on: ${{ matrix.os }}
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
os: [ubuntu-latest, windows-latest]
44+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 2
51+
52+
- name: Set up Python ${{ matrix.python-version }}
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: ${{ matrix.python-version }}
56+
57+
- name: Install dependencies
58+
run: |
59+
python -m pip install --upgrade pip
60+
pip install -e ".[dev]"
61+
62+
- name: Run unit tests with coverage
63+
run: |
64+
python -m pytest tests/unit --cov=fmd_api --cov-branch --cov-report=xml --cov-report=term -v
65+
66+
- name: Upload coverage to Codecov
67+
uses: codecov/codecov-action@v5
68+
with:
69+
files: ./coverage.xml
70+
flags: unittests
71+
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
72+
fail_ci_if_error: false
73+
token: ${{ secrets.CODECOV_TOKEN }}
74+
75+
- name: Run functional tests (if credentials available)
76+
# Skip on PRs from forks where secrets aren't available
77+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
78+
continue-on-error: true
79+
run: |
80+
python -m pytest tests/functional -v
81+
env:
82+
# Optional: set up test credentials as repository secrets
83+
FMD_BASE_URL: ${{ secrets.FMD_BASE_URL }}
84+
FMD_ID: ${{ secrets.FMD_ID }}
85+
FMD_PASSWORD: ${{ secrets.FMD_PASSWORD }}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# fmd_api: Python client for FMD (Find My Device)
22

3+
[![Tests](https://github.com/devinslick/fmd_api/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/devinslick/fmd_api/actions/workflows/test.yml)
4+
[![codecov](https://codecov.io/gh/devinslick/fmd_api/branch/main/graph/badge.svg?token=8WA2TKXIOW)](https://codecov.io/gh/devinslick/fmd_api)
5+
36
Modern, async Python client for the open‑source FMD (Find My Device) server. It handles authentication, key management, encrypted data decryption, location/picture retrieval, and common device commands with safe, validated helpers.
47

58
This is the v2 rewrite. The legacy, single‑file module (FmdApi in fmd_api.py) has been replaced by a proper package with clear classes and typed methods.

0 commit comments

Comments
 (0)