Skip to content

Commit eb7ecd6

Browse files
committed
Merge branch 'main' into feat/better-docs
2 parents 74d5e10 + 6b3dfdd commit eb7ecd6

37 files changed

+1182
-371
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use nix
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Common Python + Poetry Setup
2+
3+
inputs:
4+
dependency-groups:
5+
description: 'A comma-separated list of dependency groups to install'
6+
default: 'main'
7+
python-version:
8+
description: 'The Python version to use'
9+
default: '3.10'
10+
11+
runs:
12+
using: 'composite'
13+
14+
steps:
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ inputs.python-version }}
19+
20+
- name: Install poetry
21+
shell: bash
22+
run: |
23+
python -m pip install poetry
24+
poetry config virtualenvs.in-project true
25+
26+
- name: Get cache key
27+
id: cache-key
28+
shell: bash
29+
run: |
30+
key=$(echo "${{ inputs.dependency-groups }}" | sed 's/,/+/')
31+
echo "key=$key" >> "$GITHUB_OUTPUT"
32+
33+
- name: Load cached venv
34+
id: cache-dependencies
35+
uses: actions/cache@v4
36+
with:
37+
path: .venv
38+
key: venv-${{ runner.os }}-python-${{ inputs.python-version }}-groups-${{ steps.cache-key.outputs.key }}-${{ hashFiles('**/poetry.lock') }}
39+
40+
- name: Install dependencies
41+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
42+
shell: bash
43+
run: poetry install --with ${{ inputs.dependency-groups }}

.github/workflows/docs.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,10 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19-
20-
- name: Set up Python
21-
uses: actions/setup-python@v5
19+
20+
- uses: './.github/actions/setup-project'
2221
with:
23-
python-version: '3.10'
24-
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install poetry
28-
poetry config virtualenvs.in-project true
29-
poetry install
22+
dependency-groups: 'docs'
3023

3124
- name: Build documentation
3225
run: |

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,17 @@ name: Pre-commit
33
on:
44
workflow_dispatch:
55
push:
6-
branches-ignore:
7-
- main
86

97
jobs:
10-
deploy:
8+
check:
119
runs-on: ubuntu-latest
1210

1311
steps:
1412
- uses: actions/checkout@v4
15-
16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.10'
2013

21-
- name: Install dependencies
22-
run: |
23-
python -m pip install poetry
24-
poetry config virtualenvs.in-project true
25-
poetry install
14+
- uses: './.github/actions/setup-project'
15+
with:
16+
dependency-groups: 'dev,test'
2617

2718
- uses: pre-commit/action@v3.0.1
2819

.github/workflows/publish.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Set up Python
19-
uses: actions/setup-python@v5
18+
19+
- uses: './.github/actions/setup-project'
2020
with:
21-
python-version: '3.10'
22-
23-
- name: Install dependencies
24-
run: |
25-
python -m pip install poetry
26-
poetry config virtualenvs.in-project true
27-
poetry install
21+
dependency-groups: 'dev'
22+
23+
- name: Prepare README
24+
run: ./scripts/refactor_readme.py README.md
2825

2926
- name: Build package
3027
run: poetry build

.github/workflows/test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Run unit tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
versions:
9+
runs-on: ubuntu-latest
10+
11+
outputs:
12+
py-versions: ${{ steps.supported-versions.outputs.py-versions }}
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: './.github/actions/setup-project'
18+
with:
19+
dependency-groups: 'dev'
20+
21+
- id: supported-versions
22+
name: Get supported versions
23+
run: |
24+
set -e
25+
echo "py-versions=$(poetry run ./scripts/supported_py_versions.py)" >> "$GITHUB_OUTPUT"
26+
27+
test:
28+
runs-on: ubuntu-latest
29+
30+
needs: versions
31+
strategy:
32+
matrix:
33+
py-version: ${{ fromJson(needs.versions.outputs.py-versions) }}
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- uses: './.github/actions/setup-project'
39+
with:
40+
python-version: ${{ matrix.py-version }}
41+
dependency-groups: 'test'
42+
43+
- name: Run unit tests
44+
run: poetry run pytest
45+
46+
results:
47+
runs-on: ubuntu-latest
48+
needs: test
49+
steps:
50+
- run: |
51+
result="${{ needs.test.result }}"
52+
if [[ $result == "success" || $result == "skipped" ]]; then
53+
exit 0
54+
else
55+
exit 1
56+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,4 @@ cython_debug/
163163
account.json
164164
airtag.plist
165165
DO_NOT_COMMIT*
166+
.direnv/

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.1.9
3+
rev: v0.6.3
44
hooks:
55
- id: ruff
66
args: ["--fix"]
77
- id: ruff-format
88
- repo: https://github.com/RobertCraigie/pyright-python
9-
rev: v1.1.350
9+
rev: v1.1.378
1010
hooks:
1111
- id: pyright

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# FindMy.py
22

33
[![](https://img.shields.io/pypi/v/FindMy)](https://pypi.org/project/FindMy/)
4+
[![](https://img.shields.io/pypi/dm/FindMy)](#)
45
[![](https://img.shields.io/github/license/malmeloo/FindMy.py)](LICENSE.md)
56
[![](https://img.shields.io/pypi/pyversions/FindMy)](#)
67

@@ -19,13 +20,15 @@ application wishing to integrate with the Find My network.
1920
> without prior warning.
2021
>
2122
> You are encouraged to report any issues you can find on the
22-
> [issue tracker](https://github.com/malmeloo/FindMy.py/)!
23+
> [issue tracker](https://github.com/malmeloo/FindMy.py/issues/)!
2324
2425
### Features
2526

2627
- [x] Cross-platform: no Mac needed
27-
- [x] Fetch location reports
28-
- [x] Apple acount sign-in
28+
- [x] Fetch and decrypt location reports
29+
- [x] Official accessories (AirTags, iDevices, etc.)
30+
- [x] Custom AirTags (OpenHaystack)
31+
- [x] Apple account sign-in
2932
- [x] SMS 2FA support
3033
- [x] Trusted Device 2FA support
3134
- [x] Scan for nearby FindMy-devices
@@ -36,8 +39,7 @@ application wishing to integrate with the Find My network.
3639
### Roadmap
3740

3841
- [ ] Local anisette generation (without server)
39-
- Can be done using [pyprovision](https://github.com/Dadoum/pyprovision/),
40-
however I want to wait until Python wheels are available.
42+
- More information: [#2](https://github.com/malmeloo/FindMy.py/issues/2)
4143

4244
## Installation
4345

examples/_login.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# ruff: noqa: ASYNC230
2+
13
import json
24
from pathlib import Path
35

0 commit comments

Comments
 (0)