Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update actions #28

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.11'

- name: Install labels
run: pip install labels

- name: Sync config with Github
run: labels -u ${{ github.repository_owner }} -t ${{ secrets.GITHUB_TOKEN }} sync -f .github/labels.toml
15 changes: 11 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- uses: snok/install-poetry@v1
python-version: '3.11'

- name: Setup Poetry
uses: snok/install-poetry@v1

- name: Install Dependencies
run: poetry install

- name: Run linters
run: poetry run make lint

- name: Run tests
run: poetry run pytest
12 changes: 9 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ jobs:
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: '3.11'

- name: Update pyproject.toml Version
run: |
pip install tomlkit
Expand All @@ -42,6 +44,7 @@ jobs:
with open('pyproject.toml', 'w') as file:
file.write(tomlkit.dumps(content))
"

- name: Update __init__.py version
run: |
version="${{ github.event.inputs.tag }}"
Expand All @@ -57,13 +60,16 @@ jobs:
git push
git tag ${{ github.event.inputs.tag }}
git push --tags

- name: Build source and wheel distributions
run: |
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
5 changes: 4 additions & 1 deletion airthings_ble/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ def get_absolute_pressure(elevation: int, data: float) -> float:
return data + round(offset, 2)


sensor_decoders: dict[str, Callable[[bytearray], dict[str, float | None | str]],] = {
sensor_decoders: dict[
str,
Callable[[bytearray], dict[str, float | None | str]],
] = {
str(CHAR_UUID_WAVE_PLUS_DATA): __decode_wave_plus(
name="Plus", format_type="BBBBHHHHHHHH", scale=0
),
Expand Down