Skip to content

Commit

Permalink
Update __init__.py (#14)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
cdnninja and pre-commit-ci[bot] authored Apr 14, 2024
1 parent ad82f2b commit 7a5a8e0
Show file tree
Hide file tree
Showing 12 changed files with 184 additions and 184 deletions.
22 changes: 11 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
version: 2
updates:
# Enable version updates for Python
- package-ecosystem: "pip"
directory: "/"
# Check for updates once a week
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates once a week
schedule:
interval: "weekly"
# Enable version updates for Python
- package-ecosystem: "pip"
directory: "/"
# Check for updates once a week
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates once a week
schedule:
interval: "weekly"
100 changes: 50 additions & 50 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,64 +12,64 @@
name: "CodeQL"

on:
push:
branches: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
schedule:
- cron: "28 14 * * 1"
push:
branches: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
schedule:
- cron: "28 14 * * 1"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["python"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
strategy:
fail-fast: false
matrix:
language: ["python"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
26 changes: 13 additions & 13 deletions .github/workflows/lintPR.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
runs-on: ubuntu-latest
steps:
# Please look up the latest version from
# https://github.com/amannn/action-semantic-pull-request/releases
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
main:
runs-on: ubuntu-latest
steps:
# Please look up the latest version from
# https://github.com/amannn/action-semantic-pull-request/releases
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 changes: 35 additions & 35 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,41 @@
name: Test Builds

on:
pull_request_target:
branches:
- master
pull_request_target:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
env:
CDNNINJA_USERNAME: ${{ secrets.CDNNINJA_USERNAME }}
CDNNINJA_PASSWORD: ${{ secrets.CDNNINJA_PASSWORD }}
run: |
pytest
steps:
- uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
env:
CDNNINJA_USERNAME: ${{ secrets.CDNNINJA_USERNAME }}
CDNNINJA_PASSWORD: ${{ secrets.CDNNINJA_PASSWORD }}
run: |
pytest
122 changes: 61 additions & 61 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
name: Release
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
workflow_dispatch:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Gets semantic release info
id: semantic_release_info
uses: jossef/action-semantic-release-info@v2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Update Version and Commit
if: ${{steps.semantic_release_info.outputs.version != ''}}
run: |
echo "Version: ${{steps.semantic_release_info.outputs.version}}"
sed -i "s/version=\".*\",/version=\"${{steps.semantic_release_info.outputs.version}}\",/g" setup.py
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "chore: bumping version to ${{steps.semantic_release_info.outputs.version}}"
git tag ${{ steps.semantic_release_info.outputs.git_tag }}
- name: Push changes
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: ad-m/[email protected]
with:
github_token: ${{ github.token }}
tags: true
- name: Create GitHub Release
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ steps.semantic_release_info.outputs.git_tag }}
release_name: ${{ steps.semantic_release_info.outputs.git_tag }}
body: ${{ steps.semantic_release_info.outputs.notes }}
draft: false
prerelease: false
- name: Install dependencies
if: ${{steps.semantic_release_info.outputs.version != ''}}
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
if: ${{steps.semantic_release_info.outputs.version != ''}}
run: python -m build
- name: Publish package to PyPi Test
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to PyPi Live
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Gets semantic release info
id: semantic_release_info
uses: jossef/action-semantic-release-info@v2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Update Version and Commit
if: ${{steps.semantic_release_info.outputs.version != ''}}
run: |
echo "Version: ${{steps.semantic_release_info.outputs.version}}"
sed -i "s/version=\".*\",/version=\"${{steps.semantic_release_info.outputs.version}}\",/g" setup.py
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "chore: bumping version to ${{steps.semantic_release_info.outputs.version}}"
git tag ${{ steps.semantic_release_info.outputs.git_tag }}
- name: Push changes
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: ad-m/[email protected]
with:
github_token: ${{ github.token }}
tags: true
- name: Create GitHub Release
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ steps.semantic_release_info.outputs.git_tag }}
release_name: ${{ steps.semantic_release_info.outputs.git_tag }}
body: ${{ steps.semantic_release_info.outputs.notes }}
draft: false
prerelease: false
- name: Install dependencies
if: ${{steps.semantic_release_info.outputs.version != ''}}
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
if: ${{steps.semantic_release_info.outputs.version != ''}}
run: python -m build
- name: Publish package to PyPi Test
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to PyPi Live
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Early days of this API. Plan is to use this for home assistant.
Early days of this API. Plan is to use this for home assistant.

To run this code for test I am doing:

Expand All @@ -9,10 +9,10 @@ import os

path_root = r"C:path to files GitHub\main\yoto_api"
sys.path.append(str(path_root))
from yoto_api import *
from yoto_api import \*

logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format='%(asctime)s %(name)s %(levelname)s:%(message)s')
logger = logging.getLogger(__name__)
logger = logging.getLogger(**name**)

ym = YotoManager(username="username", password="password")
print (ym.players)
print (ym.players)
Loading

0 comments on commit 7a5a8e0

Please sign in to comment.