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
163 changes: 79 additions & 84 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,80 @@
---
name: Linting
name: Linting

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.11"

jobs:
codespell:
name: codespell
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Check code for common misspellings
run: poetry run codespell **/*.py

ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run ruff linter
run: poetry run ruff check --output-format=github .
# - name: 🚀 Run ruff formatter
# run: poetry run ruff format --check .

pylint:
name: pylint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run pylint
run: poetry run pylint **/*.py
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
DEFAULT_PYTHON: "3.11"
jobs:
codespell:
name: codespell
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Check code for common misspellings
run: poetry run codespell **/*.py
ruff:
name: ruff
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run ruff linter
run: poetry run ruff check --output-format=github .
# - name: 🚀 Run ruff formatter
# run: poetry run ruff format --check .
pylint:
name: pylint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run pylint
run: poetry run pylint **/*.py
62 changes: 46 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,56 @@
name: Upload Python Package
name: Release

# yamllint disable-line rule:truthy
on:
release:
types: [created]
types:
- published

env:
DEFAULT_PYTHON: "3.11"

jobs:
deploy:
release:
name: Releasing to PyPi
runs-on: ubuntu-latest
# environment:
# name: release
# url: https://pypi.org/p/python-homeassistant-analytics
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
with:
python-version: "3.x"
- name: Install dependencies
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_APITOKEN }}
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install dependencies
run: poetry install --no-interaction
- name: 🏗 Set package version
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
version="${{ github.event.release.tag_name }}"
version="${version,,}"
version="${version#v}"
poetry version --no-interaction "${version}"
- name: 🏗 Build package
run: poetry build --no-interaction
- name: 🚀 Publish to PyPi
uses: pypa/gh-action-pypi-publish@v1.9.0
with:
verbose: true
print-hash: true
# - name: ✍️ Sign published artifacts
# uses: sigstore/gh-action-sigstore-python@v3.0.0
# with:
# inputs: ./dist/*.tar.gz ./dist/*.whl
# release-signing-artifacts: true
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "pyvicare"
name = "pyvicare-neo"
version = "0.1.0"
description = "Library to communicate with the Viessmann ViCare API."
authors = [
Expand Down