Skip to content

Commit

Permalink
Add apk version
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Feb 3, 2019
1 parent f4fe1be commit 46df873
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ param | alias | description
`--repo` | `-R` | Name of the repo for the add-on, this is optional and defaults to `addon-ADDONNAME`.
`--test` | `None` | If this flag is used commits will be omitted.
`--verbose` | `None` | Print more stuff to the console.
`--release` | `None` | Creates a new release this argument require release version eg. `v1.0.3`.
`--apk_version` | `None` | Target version of apk packages, like `3.9`.
`--skip_apk` | `None` | Skip apk updates.
`--skip_custom` | `None` | Skip custom updates.
`--skip_pip` | `None` | Skip pip updates.
`--skip_base` | `None` | Skip base image updates.
`--fork` | `None` | Create a fork before creating a pull request, useful if you don't have access to the repo.
`--org` | `None` | Specify GitHub org, defaults to 'hassio-addons'.
`-pull_request` | `-PR` | Create a PR instead of pushing directly to master.

Expand Down
7 changes: 5 additions & 2 deletions addonupdater/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
@click.option('--repo', '-R', default=None, help='Addon repo.')
@click.option('--test', is_flag=True, help="Test run, will not commit.")
@click.option('--verbose', is_flag=True, help="Print more stuff.")
@click.option(
"--apk_version", type=float, default=3.9,
help="Default target APK version.")
@click.option('--org', default=None, help="Specify GitHub org.")
@click.option('--skip_apk', is_flag=True, help="Skip apk updates.")
@click.option('--skip_pip', is_flag=True, help="Skip pip updates.")
Expand All @@ -16,12 +19,12 @@
"of commiting to master.")
def cli(
token, addon, repo, test, verbose, skip_apk, skip_pip, skip_custom,
org, pull_request):
org, pull_request, apk_version):
"""CLI for this package."""
from addonupdater.updater import AddonUpdater
updater = AddonUpdater(
token, addon, repo, test, verbose, skip_apk, skip_pip, skip_custom,
org, pull_request)
org, pull_request, apk_version)
updater.update_addon()


Expand Down
6 changes: 4 additions & 2 deletions addonupdater/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AddonUpdater():
def __init__(
self, token, name, repo=None, test=False, verbose=False,
skip_apk=False, skip_pip=False, skip_custom=False, org=None,
pull_request=False):
pull_request=False, apk_version=3.9):
"""Initilalize."""
self.name = name
self.repo = repo
Expand All @@ -38,6 +38,7 @@ def __init__(
self.token = token
self.pull_request = pull_request
self.verbose = verbose
self.apk_version = apk_version
self.skip_apk = skip_apk
self.skip_pip = skip_pip
self.org = ORG if org is None else org
Expand All @@ -48,7 +49,8 @@ def __init__(
apk=True if not self.skip_apk else False,
pip=True if not self.skip_pip else False, test=self.test,
verbose=self.verbose, docker_path=self.name,
python_req_path=self.name, pull_request=self.pull_request)
python_req_path=self.name, pull_request=self.pull_request,
apk_version=self.apk_version)

def update_addon(self):
"""Run through updates for an addon."""
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
LONG = fh.read()
setuptools.setup(
name="addonupdater",
version="0.1.0",
version="0.1.1",
author="Joakim Sorensen",
author_email="ludeeus@gmail.com",
description="",
long_description=LONG,
install_requires=['click', 'PyGithub>=1.43.5', 'repoupdater'],
install_requires=['click', 'PyGithub>=1.43.5', 'repoupdater==0.2.2'],
long_description_content_type="text/markdown",
url="https://github.com/ludeeus/addonupdater",
packages=setuptools.find_packages(),
Expand Down

0 comments on commit 46df873

Please sign in to comment.