Skip to content

Commit 735b128

Browse files
committed
Merge pull request kivy#601 from tito/parse-requirements-version
Parse and export in environ requirements version
2 parents 6beac27 + 8df267e commit 735b128

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pythonforandroid/toolchain.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,17 @@ def __init__(self):
278278
args, unknown = parser.parse_known_args(sys.argv[1:])
279279
self.dist_args = args
280280

281+
# strip version from requirements, and put them in environ
282+
requirements = []
283+
for requirement in split_argument_list(args.requirements):
284+
if "==" in requirement:
285+
requirement, version = requirement.split(u"==", 1)
286+
os.environ["VERSION_{}".format(requirement)] = version
287+
info('Recipe {}: version "{}" requested'.format(
288+
requirement, version))
289+
requirements.append(requirement)
290+
args.requirements = u",".join(requirements)
291+
281292
if args.debug:
282293
logger.setLevel(logging.DEBUG)
283294
self.sdk_dir = args.sdk_dir

0 commit comments

Comments
 (0)