Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
CFenner authored Sep 25, 2024
2 parents 2c30c02 + 8a0dcfd commit 2655d9c
Show file tree
Hide file tree
Showing 33 changed files with 10,406 additions and 837 deletions.
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

57 changes: 57 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name-template: "$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
sort-direction: ascending

categories:
- title: "🚨 Breaking changes"
labels:
- "breaking-change"
- title: "✨ New features"
labels:
- "new-feature"
- title: "🐛 Bug fixes"
labels:
- "bugfix"
- title: "🚀 Enhancements"
labels:
- "enhancement"
- "refactor"
- "performance"
- title: "🧰 Maintenance"
labels:
- "maintenance"
- "ci"
- title: "📚 Documentation"
labels:
- "documentation"
- title: "⬆️ Dependency updates"
labels:
- "dependencies"

version-resolver:
major:
labels:
- "major"
- "breaking-change"
minor:
labels:
- "minor"
- "new-feature"
patch:
labels:
- "bugfix"
- "chore"
- "ci"
- "dependencies"
- "documentation"
- "enhancement"
- "performance"
- "refactor"
default: patch

template: |
## What’s changed
$CHANGES
13 changes: 13 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"labels": ["dependencies"],
"packageRules": [
{
"matchDepTypes": ["devDependencies"],
"labels": ["maintenance"]
}
]
}
58 changes: 0 additions & 58 deletions .github/workflows/build.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release Drafter

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

jobs:
update_release_draft:
name: ✏️ Draft release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- name: 🚀 Run Release Drafter
uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82 changes: 82 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Lint

# yamllint disable-line rule:truthy
on:
push:
branches:
- master
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/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
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/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
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/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
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
58 changes: 42 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,52 @@
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: PyPI
url: https://pypi.org/p/PyViCare
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/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
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/[email protected]
with:
verbose: true
print-hash: true
password: ${{ secrets.PYPI_APITOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test

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

env:
DEFAULT_PYTHON: "3.11"

jobs:
pytest:
name: Python ${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ matrix.python }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install dependencies
run: poetry install --no-interaction
- name: 🚀 Run pytest
run: poetry run pytest --cov PyViCare
- name: ⬆️ Upload coverage artifact
uses: actions/[email protected]
with:
name: coverage-${{ matrix.python }}
path: .coverage
37 changes: 37 additions & 0 deletions .github/workflows/type.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Type

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

env:
DEFAULT_PYTHON: "3.11"

jobs:
mypy:
name: mypy
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
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 dependencies
run: poetry install --no-interaction
- name: 🚀 Run mypy
run: poetry run mypy PyViCare tests
Loading

0 comments on commit 2655d9c

Please sign in to comment.