Require semver in main requirements.txt
Remove optional checks from repository.py Change-Id: I038f123fec8f41f7fdea254e87e93e66a5cb9180
This commit is contained in:
parent
8d4d3761d7
commit
3ca2c3bb54
@ -30,4 +30,4 @@ peewee
|
|||||||
|
|
||||||
|
|
||||||
# if you want to use complex version check in repositories
|
# if you want to use complex version check in repositories
|
||||||
# semver
|
semver
|
||||||
|
@ -17,17 +17,11 @@ from collections import defaultdict
|
|||||||
|
|
||||||
import errno
|
import errno
|
||||||
import os
|
import os
|
||||||
|
import semver
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from solar import utils
|
from solar import utils
|
||||||
|
|
||||||
try:
|
|
||||||
import semver
|
|
||||||
except ImportError:
|
|
||||||
_semver = False
|
|
||||||
else:
|
|
||||||
_semver = True
|
|
||||||
|
|
||||||
|
|
||||||
class RepositoryException(Exception):
|
class RepositoryException(Exception):
|
||||||
pass
|
pass
|
||||||
@ -75,9 +69,6 @@ class Repository(object):
|
|||||||
if os.path.exists(os.path.join(single_path, 'meta.yaml')):
|
if os.path.exists(os.path.join(single_path, 'meta.yaml')):
|
||||||
yield pth, single_path
|
yield pth, single_path
|
||||||
else:
|
else:
|
||||||
if not _semver:
|
|
||||||
raise RepositoryException("You need semver support "
|
|
||||||
"for complex version matching")
|
|
||||||
if not os.path.isdir(single_path):
|
if not os.path.isdir(single_path):
|
||||||
continue
|
continue
|
||||||
for single in os.listdir(single_path):
|
for single in os.listdir(single_path):
|
||||||
@ -211,9 +202,6 @@ class Repository(object):
|
|||||||
resource_name = spec['resource_name']
|
resource_name = spec['resource_name']
|
||||||
if version_sign == '==':
|
if version_sign == '==':
|
||||||
return os.path.join(self.fpath, spec['resource_name'], version)
|
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)
|
found = self.iter_contents(resource_name)
|
||||||
if version is None:
|
if version is None:
|
||||||
sc = semver.compare
|
sc = semver.compare
|
||||||
|
@ -14,6 +14,3 @@ os-testr
|
|||||||
# to test if everything works on gevent
|
# to test if everything works on gevent
|
||||||
gevent
|
gevent
|
||||||
|
|
||||||
|
|
||||||
# semver for version tests
|
|
||||||
semver
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user