Skip to content

Commit

Permalink
breaking(core): new library interface (#181)
Browse files Browse the repository at this point in the history
* breaking(core): new interface (#179)

* wokring on new library interface

* wokring on new library interface

* added more unit test backed by mock jsons

* allow discovery to return a tapo device from factory

* added ci review

* added ci review

* added ci review

* added ci review

* added ci review

* added ci review

* remove useless arp discovery

* added device type

* added new interface for library

* done main refactory using component game pattern

* refactor build pipeline

* added dev channel as release trigger

* add code review for each channels

* fix missing implementation fake protocol testing

* chore(ci): fix action setup version

* fix(core): broken api package

* fix(core): remove guess protocol

* chore(ci): force release

* chore(release): 5.0.0-dev.1 [skip ci]

# [5.0.0-dev.1](v4.0.3...5.0.0-dev.1) (2024-03-25)

### Bug Fixes

* **core:** broken api package ([dd71fb1](dd71fb1))
* **core:** remove guess protocol ([a0bb767](a0bb767))

* fix(ci): force patch release

* chore(release): 5.0.0-dev.2 [skip ci]

# [5.0.0-dev.2](5.0.0-dev.1...5.0.0-dev.2) (2024-03-25)

### Bug Fixes

* **ci:** force patch release ([38a7b6e](38a7b6e))

* fix(core): expose device raw_state

* chore(release): 5.0.0-dev.3 [skip ci]

# [5.0.0-dev.3](5.0.0-dev.2...5.0.0-dev.3) (2024-03-29)

### Bug Fixes

* **core:** expose device raw_state ([a571b7a](a571b7a))

* fix(core): improve bulb interface

* fix(core): device discovery now detect right protocol

* chore(release): 5.0.0-dev.4 [skip ci]

# [5.0.0-dev.4](5.0.0-dev.3...5.0.0-dev.4) (2024-04-06)

### Bug Fixes

* **core:** device discovery now detect right protocol ([e78dff3](e78dff3))
* **core:** improve bulb interface ([bcd34c3](bcd34c3))

* fix(core): now encryption schema can be nullable

* fix(core): hub pagination children

* chore(release): 5.0.0-dev.5 [skip ci]

# [5.0.0-dev.5](5.0.0-dev.4...5.0.0-dev.5) (2024-04-06)

### Bug Fixes

* **core:** hub pagination children ([51ac445](51ac445))
* **core:** now encryption schema can be nullable ([f7ead0d](f7ead0d))

* fix(core): remove print discovered devices

* fix(core): energy component right interface

* chore(docs): update documentation to new interface

* chore(release): 5.0.0-dev.6 [skip ci]

# [5.0.0-dev.6](5.0.0-dev.5...5.0.0-dev.6) (2024-04-06)

### Bug Fixes

* **core:** energy component right interface ([66cff28](66cff28))
* **core:** remove print discovered devices ([040b89b](040b89b))

---------

Co-authored-by: semantic-release-bot <[email protected]>
  • Loading branch information
petretiandrea and semantic-release-bot authored Apr 6, 2024
1 parent 197fc15 commit 34dc559
Show file tree
Hide file tree
Showing 125 changed files with 5,847 additions and 1,682 deletions.
62 changes: 51 additions & 11 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
name: Release plugp100

on:
release:
types: [published]
workflow_dispatch:
push:
branches:
- fix/manylinux
- main
- next
- dev
# tags:
# - v*.*.*

Expand Down Expand Up @@ -51,18 +52,22 @@ jobs:


publish_pypi:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
name: Publish to PyPi
runs-on: ubuntu-latest
# needs: [ build_vendoring_wheels ]

steps:
- uses: actions/[email protected]
# - name: "Retrieve compiled requirements"
# uses: actions/download-artifact@v3
# with:
# name: wheel
# path: ./dist
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version: 20

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -71,13 +76,48 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Semantic Release (Dry Run)
id: semantic
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 23.0.2
branches: |
[ 'main', {name: 'next', prerelease: true}, {name: 'dev', channel: 'dev', prerelease: true} ]
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Bump version file
run: sed -i 's/__version__ = ".*"/__version__ = \"${{ steps.semantic.outputs.new_release_version }}\"/g' plugp100/__init__.py

- name: Generating Any and Source Distribution
run: |
python setup.py sdist bdist_wheel
ls -R
- name: Publish source distribution to PyPi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
twine upload dist/*
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 23.0.2
branches: |
[ 'main', {name: 'next', prerelease: true}, {name: 'dev', channel: 'dev', prerelease: true}]
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57 changes: 55 additions & 2 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,49 @@
name: Code Review
on: pull_request
on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- main
- dev
- next

permissions:
pull-requests: write
statuses: write

jobs:
validate-pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
docs
refactor
chore
fix
feat
breaking
scopes: |
ci
core
requireScope: true
ignoreLabels: |
bot
subjectPattern: ^.+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
wip: true
black:
name: Linting & Test
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
Expand All @@ -18,4 +59,16 @@ jobs:
black --check --verbose .
- name: "Test code"
run: |
python -m unittest discover -s tests/unit
pytest \
--durations=10 \
--cov-fail-under=60 \
--junitxml=pytest.xml \
--cov-report=term-missing:skip-covered \
--cov=app \
-p no:sugar \
tests/unit | tee pytest-coverage.txt
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
15 changes: 0 additions & 15 deletions .github/workflows/release-drafter.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ requirements-*.txt

.local.devices.yml

plugp100/local_run.py
**/local_run.py
41 changes: 41 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"branches": [
"main",
{
"name": "next",
"prerelease": true
},
{
"name": "dev",
"channel": "dev",
"prerelease": true
}
],
"ci": true,
"tagFormat": "${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{
"type": "breaking",
"release": "major"
}
]
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/git",
{
"assets": [
"plugp100/__init__.py"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
Loading

0 comments on commit 34dc559

Please sign in to comment.