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

Rename master and add labeler #243

Merged
merged 4 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
41 changes: 41 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Contribution Guidelines

Thank you for considering contributing! We welcome contributions in the form of bug reports, feature requests, code patches, or documentation improvements.

Please follow these guidelines to ensure a smooth contribution process.

## Bug Reports

If you've found a bug, please create a bug report. Make sure to provide the following information:

- **Environment Information:** (e.g., Home Assistant version, HA Toyota version)
CM000n marked this conversation as resolved.
Show resolved Hide resolved
- **Steps to Reproduce the Bug:**
- **Expected Behavior:**
- **Current Behavior:**

## Feature Requests

If you have an idea for a new feature, please create a feature request. Describe the desired feature and why it would be useful.

## Code Contributions

We welcome code contributions! If you'd like to participate in development, follow these steps:

1. Fork this repository.
2. Create a branch for your changes: e.g `git checkout -b feature/feature_description` or `git checkout -b bug/bug_description`.
3. Develop and test your changes.
4. Ensure your code complies with style guidelines: `poetry run pre-commit run --all-files`.
5. Create a pull request in this repository with a clear description of the changes.

### Development Requirements

- Dependencies are managed with [Poetry](https://python-poetry.org/). Add new dependencies to the `pyproject.toml` file and run `poetry install`.
- Style guidelines are enforced with [pre-commit](https://pre-commit.com/). Install pre-commit with `poetry run pre-commit install`.

### Tests

Ensure that all tests pass successfully before creating a pull request.

```bash
poetry run pytest
```
17 changes: 8 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
---
version: 2
updates:
- package-ecosystem: pip
- package-ecosystem: "pip"
directory: "/"
versioning-strategy: lockfile-only
versioning-strategy: "lockfile-only"
schedule:
interval: weekly
labels:
- "dependencies"
- package-ecosystem: github-actions
interval: "weekly"
labels: [":robot: bot", ":game_die: dependencies"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
labels:
- "dependencies"
interval: "weekly"
labels: [":robot: bot", ":game_die: dependencies"]
71 changes: 71 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
- name: ":bell: automerge"
color: "8f4fbc"
description: ""
- name: ":robot: bot"
color: "69cde9"
description: ""
- name: ":bug: bug"
color: "b60205"
description: ""
- name: ":warning: breaking change"
color: "b60205"
description: ""
- name: ":game_die: dependencies"
color: "0366d6"
description: ""
- name: ":memo: documentation"
color: "c5def5"
description: ""
- name: ":busts_in_silhouette: duplicate"
color: "cccccc"
description: ""
- name: ":speech_balloon: translation"
color: "b2a8a6"
description: ""
- name: ":wrench: enhancement"
color: "0054ca"
description: ""
- name: ":rocket: feature"
color: "0e8a16"
description: ""
- name: ":mega: feedback"
color: "03a9f4"
description: ""
- name: ":clock10: future maybe"
color: "fef2c0"
description: ""
- name: ":hatching_chick: good first issue"
color: "7057ff"
description: ""
- name: ":pray: help wanted"
color: "4caf50"
description: ""
- name: ":no_entry_sign: invalid"
color: "e6e6e6"
description: ""
- name: ":mag: investigate"
color: "e6625b"
description: ""
- name: ":thinking: needs more info"
color: "795548"
description: ""
- name: ":pushpin: pinned"
color: "28008e"
description: ""
- name: ":question: question"
color: "3f51b5"
description: ""
- name: ":skull: stale"
color: "237da0"
description: ""
- name: ":eyes: upstream"
color: "fbca04"
description: ""
- name: ":construction_worker: WIP"
color: "668000"
description: ""
- name: ":coffin: wontfix"
color: "ffffff"
description: ""
20 changes: 7 additions & 13 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@ tag-template: "v$RESOLVED_VERSION"
sort-direction: ascending
categories:
- title: "⚠ Breaking changes"
label: "breaking change"
labels: [":warning: breaking change"]
- title: "🚀 Features"
labels:
- "feature"
labels: [":rocket: feature"]
- title: "🔧 Code enhancements"
labels:
- "enhancement"
labels: [":wrench: enhancement"]
- title: "🐛 Bug Fixes"
labels:
- "fix"
- "bugfix"
- "bug"
labels: [":bug: bug"]
- title: "🈵 Translations"
labels: [":speech_balloon: translation"]
- title: "📄 Documentation"
label: "documentation"
- title: "🧱 Dependency Updates"
labels:
- "dependencies"
labels: [":memo: documentation"]
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
template: |
Expand Down
42 changes: 16 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,34 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build package
name: "Build package"

on:
push:
branches:
- master
- "v0.7"
branches: ["master", "main"]
pull_request:
branches:
- master
- "v0.7"
branches: ["master", "main"]

jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v4"
- name: "🐍 Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v4"
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/[email protected]
python-version: "${{ matrix.python-version }}"
- name: "⚙️ Install Poetry"
uses: "abatilo/[email protected]"
with:
poetry-version: 1.5.1

- name: Install dependencies
run: poetry install

- name: Test package building
run: |
poetry build
- name: "⚙️ Install dependencies"
run: "poetry install"
- name: "🚀 Test package building"
run: "poetry build"
18 changes: 18 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: "Manage labels"

on:
schedule:
- cron: "0 0 * * *"

jobs:
labeler:
name: "Labeler"
runs-on: "ubuntu-latest"
steps:
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v4"
- name: "🚀 Run Labeler"
uses: "crazy-max/ghaction-github-labeler@v5"
with:
skip-delete: false
50 changes: 21 additions & 29 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,46 @@
name: Linting
name: "Linting"

on:
push:
branches:
- master
- "v0.7"
branches: ["master", "main"]
pull_request:

jobs:
pre-commit:
name: Pre-commit
name: "Pre-commit"
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
env:
OS: ubuntu-latest
PYTHON: ${{ matrix.python-version }}
OS: "ubuntu-latest"
PYTHON: "${{ matrix.python-version }}"
steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v4"
- name: "🐍 Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v4"
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/[email protected]
python-version: "${{ matrix.python-version }}"
- name: "⚙️ Install Poetry"
uses: "abatilo/[email protected]"
with:
poetry-version: 1.5.1

- name: Install dependencies
run: poetry install

- name: Run pre-commit on all files
- name: "⚙️ Install dependencies"
run: "poetry install"
- name: "🚀 Run pre-commit on all files"
run: |
poetry run pre-commit run --all-files --show-diff-on-failure --color=always

- name: Run pytest with coverage
- name: "🚀 Run pytest with coverage"
run: |
poetry run pip install coverage
poetry run coverage run -m pytest
poetry run coverage xml

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
- name: "⬆️ Upload Coverage to Codecov"
uses: "codecov/codecov-action@v3"
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: "${{ secrets.CODECOV_TOKEN }}"
env_vars: OS,PYTHON
fail_ci_if_error: true
flags: unittests
flags: "unittests"
verbose: true
15 changes: 8 additions & 7 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package to PyPi
name: "Upload Python Package to PyPi"

on:
release:
types: [published]
types: ["published"]
jobs:
build:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Build package and publish to pypi
uses: JRubics/[email protected]
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v4"
- name: "🚀 Build package and publish to pypi"
uses: "JRubics/[email protected]"
with:
pypi_token: ${{ secrets.PYPI_PASSWORD }}
pypi_token: "${{ secrets.PYPI_PASSWORD }}"
16 changes: 7 additions & 9 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: Draft a release note
name: "Draft a release note"

on:
push:
branches:
- master
- "v0.7"
branches: ["master", "main"]

jobs:
draft_release:
name: Release Drafter
runs-on: ubuntu-latest
name: "Release Drafter"
runs-on: "ubuntu-latest"
steps:
- name: Run release-drafter
uses: release-drafter/release-drafter@v5
- name: "🚀 Run release-drafter"
uses: "release-drafter/release-drafter@v5"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"