Skip to content

Commit 26cc319

Browse files
Auto PR creating, GitHub Releases & Clean-ups (#49)
* Allow to publish PR + cleanups * Enable dependabot * Updates after linter * fix: make mypy happy * New version for clean-ups * Add release flow * fix: handle PIL library on android --------- Co-authored-by: Andrea Ghensi <[email protected]>
1 parent bd6aaab commit 26cc319

File tree

31 files changed

+1018
-586
lines changed

31 files changed

+1018
-586
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"

.github/workflows/publish-addon.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Check, release and publish addon
2+
3+
on: [push]
4+
5+
env:
6+
ADDON_NAME: script.service.hyperion
7+
TARGET_KODI_VER: nexus
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Python 3.11
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: "3.11"
18+
- name: Install addon checker
19+
run: |
20+
pip install -q kodi-addon-checker
21+
- name: Check with addon-checker
22+
run: |
23+
kodi-addon-checker --branch $TARGET_KODI_VER --allow-folder-id-mismatch $ADDON_NAME
24+
25+
github_release:
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: write
29+
30+
needs: check
31+
if: github.ref_type == 'tag'
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: Set up Python 3.11
35+
uses: actions/setup-python@v4
36+
with:
37+
python-version: "3.11"
38+
- name: Install addon submitter
39+
run: |
40+
pip install -q git+https://github.com/xbmc/kodi-addon-submitter.git
41+
- name: Package addon
42+
run: |
43+
submit-addon -s -z $ADDON_NAME
44+
- name: Publish release
45+
uses: ncipollo/release-action@v1
46+
with:
47+
artifacts: "*.zip"
48+
49+
kodi_publish:
50+
runs-on: ubuntu-latest
51+
52+
needs: check
53+
if: github.ref_type == 'tag'
54+
steps:
55+
- uses: actions/checkout@v3
56+
- name: Set up Python 3.11
57+
uses: actions/setup-python@v4
58+
with:
59+
python-version: "3.11"
60+
- name: Install addon submitter
61+
run: |
62+
pip install -q git+https://github.com/xbmc/kodi-addon-submitter.git
63+
- name: Submit addon
64+
run: |
65+
submit-addon -r repo-scripts -b $TARGET_KODI_VER -s --pull-request $ADDON_NAME
66+
env:
67+
GH_USERNAME: ${{ github.actor }}
68+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
69+
EMAIL: "${{ github.actor }}@users.noreply.github.com"

.gitignore

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
.idea/
1+
# Windows image file caches
2+
Thumbs.db
3+
ehthumbs.db
4+
5+
# Folder config file
6+
Desktop.ini
7+
8+
# python
9+
*.pyo
10+
__pycache__
11+
.idea
12+
Pipfile.lock
13+
.mypy_cache
14+
.ruff_cache

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
default_language_version:
2+
python: python3
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.3.0
6+
hooks:
7+
- id: check-toml
8+
- id: check-yaml
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
- id: check-added-large-files
12+
- repo: https://github.com/executablebooks/mdformat
13+
rev: 0.7.16
14+
hooks:
15+
- id: mdformat
16+
exclude: CHANGELOG.md
17+
additional_dependencies:
18+
- mdformat-black
19+
- mdformat-frontmatter
20+
- mdformat-admon
21+
- repo: https://github.com/psf/black
22+
rev: 22.10.0
23+
hooks:
24+
- id: black
25+
- repo: https://github.com/charliermarsh/ruff-pre-commit
26+
rev: 'v0.0.252'
27+
hooks:
28+
- id: ruff
29+
args: [--fix, --exit-non-zero-on-fix]
30+
- repo: https://github.com/pre-commit/mirrors-mypy
31+
rev: 'v1.4.1'
32+
hooks:
33+
- id: mypy
34+
additional_dependencies:
35+
- types-protobuf

Pipfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
8+
[dev-packages]
9+
kodistubs = "*"
10+
kodi-addon-checker = "*"
11+
12+
[requires]
13+
python_version = "3.11"
14+
15+
[scripts]
16+
pre-commit = "pre-commit install"
17+
lint = "pre-commit run --all"
18+
check = "kodi-addon-checker --branch nexus --allow-folder-id-mismatch script.service.hyperion-control"

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
# script.service.hyperion
1+
# Hyperion Capture for Kodi 20 (Nexus)
2+
3+
[![Latest-Release](https://img.shields.io/github/v/release/hyperion-project/hyperion.kodi?include_prereleases&label=Latest%20Release&logo=github&logoColor=white&color=0f83e7)](https://github.com/hyperion-project/hyperion.kodi/releases)
4+
[![Join Translation](https://img.shields.io/badge/POEditor-translate-green.svg)](https://poeditor.com/join/project/yKr4KrF7G2)
5+
[![Forum](https://img.shields.io/website/https/hyperion-project.org.svg?label=Forum&down_color=red&down_message=offline&up_color=4bc51d&up_message=online&logo=homeadvisor&logoColor=white)](https://www.hyperion-project.org)
26

37
Kodi add-on to capture video data and send it to Hyperion.
4-
Note that this plugin does not currently work for Kodi running on Raspberry Pi.
5-
There is an outstanding Kodi fix for that.
68

7-
Information about Hyperion can be found here: https://wiki.hyperion-project.org
9+
**Note:** This plugin does not currently work for Kodi running on Raspberry Pi. There is an outstanding Kodi fix for that.
10+
11+
Information about Hyperion can be found here: <https://docs.hyperion-project.org/>
12+
13+
### Installation
814

9-
The add-on can be installed by downloading the zip and installing it via the Kodi Add-On zip install or
10-
extracting it to the addons directory (i.e.~/.kodi/addons on Linux or %AppData%\Kodi\addons on Windows)
15+
- Download .zip from release page and use "Install from zip file" dialog at the Kodi addons section.

addon.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

pyproject.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[tool.mypy]
2+
check_untyped_defs = true
3+
disallow_any_generics = true
4+
disallow_incomplete_defs = true
5+
disallow_untyped_calls = false
6+
disallow_untyped_defs = true
7+
no_implicit_optional = true
8+
show_error_codes = true
9+
strict_equality = true
10+
strict_optional = true
11+
warn_redundant_casts = true
12+
warn_unreachable = true
13+
warn_unused_configs = true
14+
warn_unused_ignores = true
15+
16+
[tool.ruff]
17+
select = ["B", "C", "D", "E", "F", "I", "N", "S", "U", "W"]
18+
ignore = ["E501", "D212", "D103", "D107"]
19+
target-version = "py310"
20+
src = ["resources"]
21+
22+
[tool.ruff.per-file-ignores]
23+
"script.service.hyperion/resources/lib/monitor.py" = ["N802", "D102"]
24+
"script.service.hyperion/resources/lib/hyperion/message_pb2.py" = ["D100"]
25+
"__init__.py" = ["D104"]
26+
27+
[tool.ruff.pydocstyle]
28+
convention = "google"
29+
30+
[tool.ruff.isort]
31+
force-single-line = true
32+
33+
[tool.ruff.pyupgrade]
34+
keep-runtime-typing = true

resources/fanart.png

-65.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)