Require semver in main requirements.txt

Remove optional checks from repository.py

Change-Id: I038f123fec8f41f7fdea254e87e93e66a5cb9180
This commit is contained in:
Jedrzej Nowak 2015-12-21 08:30:49 +01:00 committed by Lukasz Oles
parent 8d4d3761d7
commit 3ca2c3bb54
3 changed files with 2 additions and 17 deletions

View File

@ -30,4 +30,4 @@ peewee
# if you want to use complex version check in repositories
# semver
semver

View File

@ -17,17 +17,11 @@ from collections import defaultdict
import errno
import os
import semver
import shutil
from solar import utils
try:
import semver
except ImportError:
_semver = False
else:
_semver = True
class RepositoryException(Exception):
pass
@ -75,9 +69,6 @@ class Repository(object):
if os.path.exists(os.path.join(single_path, 'meta.yaml')):
yield pth, single_path
else:
if not _semver:
raise RepositoryException("You need semver support "
"for complex version matching")
if not os.path.isdir(single_path):
continue
for single in os.listdir(single_path):
@ -211,9 +202,6 @@ class Repository(object):
resource_name = spec['resource_name']
if version_sign == '==':
return os.path.join(self.fpath, spec['resource_name'], version)
if not _semver:
raise RepositoryException("You need semver support "
"for complex version matching")
found = self.iter_contents(resource_name)
if version is None:
sc = semver.compare

View File

@ -14,6 +14,3 @@ os-testr
# to test if everything works on gevent
gevent
# semver for version tests
semver