add alias for hostpython/python, that point to either 2 or 3 version depending of the previous compiled state.
This allows the recipe to point on an versionless python.
This commit is contained in:
parent
9762ee754c
commit
811cbd48a7
10 changed files with 130 additions and 40 deletions
recipes
15
recipes/python.py
Normal file
15
recipes/python.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from toolchain import Recipe
|
||||
|
||||
class PythonAliasRecipe(Recipe):
|
||||
is_alias = True
|
||||
|
||||
def init_after_import(self, ctx):
|
||||
python = ctx.state.get("python")
|
||||
if not python:
|
||||
print("WARNING: no python set yet, so you need to specify")
|
||||
print("WARNING: either python2 or python3 in your deps")
|
||||
else:
|
||||
self.depends = [python]
|
||||
|
||||
recipe = PythonAliasRecipe()
|
Loading…
Add table
Add a link
Reference in a new issue