Merge pull request #471 from AndreMiras/feature/track_broken_recipes
Do not build known broken recipes
This commit is contained in:
commit
b831483cda
3 changed files with 45 additions and 8 deletions
19
.ci/constants.py
Normal file
19
.ci/constants.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
BROKEN_RECIPES = set(
|
||||||
|
[
|
||||||
|
# no attribute 'SourceFileLoader'
|
||||||
|
# https://github.com/kivy/kivy-ios/issues/466
|
||||||
|
"distribute",
|
||||||
|
# 'distutils.core' is not a package
|
||||||
|
# https://github.com/kivy/kivy-ios/issues/467
|
||||||
|
"markupsafe",
|
||||||
|
# depends on markupsafe
|
||||||
|
# https://github.com/kivy/kivy-ios/issues/466
|
||||||
|
"jinja2",
|
||||||
|
# bad install directory or PYTHONPATH
|
||||||
|
# https://github.com/kivy/kivy-ios/issues/468
|
||||||
|
"werkzeug",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
# recipes that were already built will be skipped
|
||||||
|
CORE_RECIPES = set(["kivy", "hostpython3", "python3"])
|
|
@ -1,9 +1,19 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
"""
|
||||||
|
Continuous Integration helper script.
|
||||||
|
Automatically detects recipes modified in a changeset (compares with master)
|
||||||
|
and recompiles them.
|
||||||
|
|
||||||
|
Current limitations:
|
||||||
|
- will fail on conflicting requirements
|
||||||
|
"""
|
||||||
import sh
|
import sh
|
||||||
import subprocess
|
import subprocess
|
||||||
from fnmatch import fnmatch
|
from fnmatch import fnmatch
|
||||||
|
from constants import CORE_RECIPES, BROKEN_RECIPES
|
||||||
|
|
||||||
|
|
||||||
def modified_recipes(branch='origin/master'):
|
def modified_recipes(branch="origin/master"):
|
||||||
"""
|
"""
|
||||||
Returns a set of modified recipes between the current branch and the one
|
Returns a set of modified recipes between the current branch and the one
|
||||||
in param.
|
in param.
|
||||||
|
@ -12,18 +22,27 @@ def modified_recipes(branch='origin/master'):
|
||||||
# with a bunch of fixes, e.g. disabled TTY, see:
|
# with a bunch of fixes, e.g. disabled TTY, see:
|
||||||
# https://stackoverflow.com/a/20128598/185510
|
# https://stackoverflow.com/a/20128598/185510
|
||||||
sh.contrib.git.fetch("origin", "master")
|
sh.contrib.git.fetch("origin", "master")
|
||||||
git_diff = sh.contrib.git.diff('--name-only', branch)
|
git_diff = sh.contrib.git.diff("--name-only", branch)
|
||||||
recipes = set()
|
recipes = set()
|
||||||
for file_path in git_diff:
|
for file_path in git_diff:
|
||||||
if fnmatch(file_path, "recipes/*/__init__.py\n"):
|
if fnmatch(file_path, "recipes/*/__init__.py\n"):
|
||||||
recipe = file_path.split('/')[1]
|
recipe = file_path.split("/")[1]
|
||||||
recipes.add(recipe)
|
recipes.add(recipe)
|
||||||
return recipes
|
return recipes
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def main():
|
||||||
updated_recipes = " ".join(modified_recipes())
|
recipes = modified_recipes()
|
||||||
if updated_recipes != '':
|
recipes -= CORE_RECIPES
|
||||||
subprocess.run(f"python3 toolchain.py build {updated_recipes}", shell=True, check=True)
|
recipes -= BROKEN_RECIPES
|
||||||
|
updated_recipes = " ".join(recipes)
|
||||||
|
if updated_recipes != "":
|
||||||
|
subprocess.run(
|
||||||
|
f"python3 toolchain.py build {updated_recipes}", shell=True, check=True
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
print("Nothing to do. No updated recipes.")
|
print("Nothing to do. No updated recipes.")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
|
@ -6,7 +6,6 @@ import os
|
||||||
|
|
||||||
class DistributeRecipe(PythonRecipe):
|
class DistributeRecipe(PythonRecipe):
|
||||||
version = "0.7.3"
|
version = "0.7.3"
|
||||||
# url = "https://github.com/mitsuhiko/click/archive/{version}.zip"
|
|
||||||
url = "https://pypi.python.org/packages/source/d/distribute/distribute-{version}.zip"
|
url = "https://pypi.python.org/packages/source/d/distribute/distribute-{version}.zip"
|
||||||
depends = ["python"]
|
depends = ["python"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue