Skip to content

Commit

Permalink
Fix looseversion error (#78)
Browse files Browse the repository at this point in the history
Due to None being passed to the methods
  • Loading branch information
razzeee authored May 30, 2018
1 parent 0842d96 commit 58bd3c0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis-addon.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ install:

# command to run our tests
script:
- kodi-addon-checker .
- kodi-addon-checker . --branch=BRANCH_NAME
4 changes: 2 additions & 2 deletions .travis-repo.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ install:

# command to run our tests
script:
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then kodi-addon-checker; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then kodi-addon-checker $(git diff --diff-filter=d --name-only HEAD~ | grep / | cut -d / -f1 | sort | uniq); fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then kodi-addon-checker --branch=BRANCH_NAME; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then kodi-addon-checker --branch=BRANCH_NAME $(git diff --diff-filter=d --name-only HEAD~ | grep / | cut -d / -f1 | sort | uniq); fi'

notifications:
email:
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: python
matrix:
include:
- python: "3.5"
- python: "nightly"
- python: "3.6"

# command to install dependencies
install:
Expand Down
8 changes: 7 additions & 1 deletion kodi_addon_checker/check_addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ def _check_dependencies(report: Report, addon_path, repo_addons):
else:
available_version = repo_addons[required_addon]

if LooseVersion(available_version) < LooseVersion(required_version) and (required_addon not in ignore):
if required_version is None:
report.add(Record(WARNING, "Required addon %s does not require a fixed version Available: %s "
% (required_addon available_version)))
elif available_version is None:
report.add(Record(PROBLEM, "Version of %s in required version %s not available"
% (required_addon, required_version)))
elif LooseVersion(available_version) < LooseVersion(required_version) and (required_addon not in ignore):
report.add(Record(PROBLEM, "Version mismatch for addon %s. Required: %s, Available: %s "
% (required_addon, required_version, available_version)))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

setuptools.setup(
name="kodi-addon-checker",
version="0.0.2",
version="0.0.3",
description="Check kodi addons or whole kodi repositories for errors and best practices.",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 58bd3c0

Please sign in to comment.