Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 1a3a5aa

Browse files
author
Olivier Gambier
committed
DEPS=loose env var to loosen deps
Docker-DCO-1.1-Signed-off-by: Olivier Gambier <[email protected]> (github: dmp42)
1 parent 28728d1 commit 1a3a5aa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

depends/docker-registry-core/setup.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@
3838
if ver < (2, 7):
3939
requirements.insert(0, 'simplejson==3.6.2')
4040

41+
# Using this will relax dependencies to semver major matching
42+
if 'DEPS' in os.environ and os.environ['DEPS'].lower() == 'loose':
43+
loose = []
44+
for item in requirements:
45+
d = re.match(r'([^=]+)==([0-9]+)[.]([0-9]+)[.]([0-9]+)', item)
46+
if d:
47+
d = list(d.groups())
48+
name = d.pop(0)
49+
version = d.pop(0)
50+
item = '%s>=%s,<%s' % (name, int(version), int(version) + 1)
51+
loose.insert(0, item)
52+
requirements = loose
4153

4254
setuptools.setup(
4355
name=core.__title__,

0 commit comments

Comments
 (0)