Skip to content

Commit b995070

Browse files
authored
Merge pull request #1 from mietzen/fritzos-7.56
Fritzos 7.56
2 parents 2f9299c + 03575a1 commit b995070

File tree

7 files changed

+279
-149
lines changed

7 files changed

+279
-149
lines changed

.github/workflows/lint.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Python Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- 'main'
7+
8+
jobs:
9+
Test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.9", "3.10", "3.11"]
14+
fail-fast: false
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install ruff
26+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27+
- name: Lint with ruff
28+
env:
29+
PY_VER: ${{ matrix.python-version }}
30+
run: |
31+
# stop the build if there are Python syntax errors or undefined names
32+
PY_VER=$(echo py${PY_VER} | tr -d '.')
33+
ruff --format=github --ignore=E501 --exclude=__init__.py --target-version=${PY_VER} .
34+
35+
Check-Test:
36+
if: ${{ always() }}
37+
runs-on: ubuntu-latest
38+
needs:
39+
- Test
40+
steps:
41+
- run: |
42+
result="${{ needs.Test.result }}"
43+
if [[ $result == "success" || $result == "skipped" ]]; then
44+
exit 0
45+
else
46+
exit 1
47+
fi

.github/workflows/pypi.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build & Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
Setup:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
version: ${{ steps.set-version.outputs.version }}
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
- name: Get Version
18+
id: set-version
19+
env:
20+
VERSION: ${{ github.ref_name }}
21+
run: |
22+
if grep -c -E '^v[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}$' <<< ${VERSION}; then
23+
VERSION=$(sed 's/^.\{1\}//g' <<< ${VERSION})
24+
else
25+
echo "This branch shouldn't be build: ${VERSION}"
26+
exit 1
27+
fi
28+
echo "version=$(echo ${VERSION})" >> $GITHUB_OUTPUT
29+
30+
Deploy:
31+
runs-on: ubuntu-latest
32+
needs: Setup
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Set up Python
36+
uses: actions/setup-python@v3
37+
with:
38+
python-version: '3.x'
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install build
43+
- name: Build package
44+
env:
45+
VERSION: ${{ needs.Setup.outputs.version }}
46+
run: python -m build --wheel
47+
- name: Publish package
48+
uses: pypa/[email protected]
49+
with:
50+
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ But with any FritzOS upgrade this library might stop working, don't uses this if
2929
| Device | Tested in FritzOS |
3030
|:--------------:|:-----------------:|
3131
| FRITZ!DECT 301 | 7.29 |
32+
| FRITZ!DECT 301 | 7.56 |
3233

3334
If you have a different device or FritzOS version set `experimental=True` this will disable all checks, but beware there might be dragons!
3435

0 commit comments

Comments
 (0)