From afadbd0afd6eda8139058f9bc54b559d614b7c3b Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.anjos@idiap.ch> Date: Thu, 22 Feb 2018 11:11:27 +0100 Subject: [PATCH] Make sure the version of setuptools matches the one in bob-devel --- conda/conda-bootstrap.py | 24 +++++++++++++----------- gitlab/conda_build_config.yaml | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/conda/conda-bootstrap.py b/conda/conda-bootstrap.py index 47a0e77..a97fc29 100755 --- a/conda/conda-bootstrap.py +++ b/conda/conda-bootstrap.py @@ -52,20 +52,17 @@ def get_rendered_recipe(python, path): if path.endswith('meta.yaml'): path = os.path.dirname(path) - with tempfile.NamedTemporaryFile(dir=path, mode='wt', suffix='.yaml') as f: + with tempfile.TemporaryDirectory(dir=path, suffix='.tmp') as d: - # writes a temporary recipe with an injected version of bob-devel + # writes a temporary recipe without bob-devel orig = os.path.join(path, 'meta.yaml') contents = open(orig).read() - import pdb; pdb.set_trace() - result = re.search(r'^requirements:.*run:\s*\n', contents, re.MULTILINE) + result = re.search(r'requirements:\s*\n\s*host:\s*\n', contents) contents = contents[:result.end()] + \ ' - bob-devel {{ bob_devel }}.*\n' + \ contents[result.end():] - f.write(contents) - f.flush() - - cmd = [CONDA, 'render'] + get_buildopt(python) + [f.name] + with open(os.path.join(d, 'meta.yaml'), 'wt') as f: f.write(contents) + cmd = [CONDA, 'render'] + get_buildopt(python) + [d] print('$ ' + ' '.join(cmd)) env = copy.copy(os.environ) env['CONDARC'] = get_condarc() @@ -77,12 +74,17 @@ def parse_dependencies(python, path): recipe = get_rendered_recipe(python, path) return recipe['requirements'].get('host', []) + \ recipe['requirements'].get('build', []) + \ - recipe.get('test', {}).get('requires', []) + recipe['requirements'].get('run', []) + \ + recipe.get('test', {}).get('requires', []) + \ + ['bob.buildout'] #extra packages required for local dev def conda_install(subcmd, env, packages): - packages = [k.replace(' ', '=') for k in packages] - cmd = [CONDA, subcmd, '--yes', '--name', env] + packages + specs = [] + for k in packages: + if any(elem in k for elem in '><|'): specs.append(k.replace(' ', '')) + else: specs.append(k.replace(' ', '=')) + cmd = [CONDA, subcmd, '--yes', '--name', env] + specs print('$ ' + ' '.join(cmd)) env = copy.copy(os.environ) env['CONDARC'] = get_condarc() diff --git a/gitlab/conda_build_config.yaml b/gitlab/conda_build_config.yaml index 8a568f8..524f82d 100644 --- a/gitlab/conda_build_config.yaml +++ b/gitlab/conda_build_config.yaml @@ -123,7 +123,7 @@ pillow: scipy: - 0.19 setuptools: - - 36.5.0 + - 38.4.0 six: - 1.11.0 sphinx: -- GitLab