From f22d86f855c5f20391b8f629ac1be18a9bea68a6 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Mon, 26 Oct 2020 14:55:40 -0500 Subject: [PATCH 1/3] setting up cron job that installs from source using a click option, and adding to dependencies list --- .travis.yml | 8 +++++++- chaco/__init__.py | 4 ++++ ci/edmtool.py | 44 ++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad8e88035..08033bf87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,13 @@ before_install: - edm install -y wheel click coverage install: - - for toolkit in ${TOOLKITS}; do edm run -- python ci/edmtool.py install --runtime=${RUNTIME} --toolkit=${toolkit} || exit; done + - for toolkit in ${TOOLKITS}; do + if [[ ${TRAVIS_EVENT_TYPE} == "cron" ]] ; then + edm run -- python ci/edmtool.py install --runtime=${RUNTIME} --toolkit=${toolkit} --source || exit; + else + edm run -- python ci/edmtool.py install --runtime=${RUNTIME} --toolkit=${toolkit} || exit; + fi; + done script: - for toolkit in ${TOOLKITS}; do edm run -- python ci/edmtool.py test --runtime=${RUNTIME} --toolkit=${toolkit} || exit; done diff --git a/chaco/__init__.py b/chaco/__init__.py index 044dcf939..eab10bcaa 100644 --- a/chaco/__init__.py +++ b/chaco/__init__.py @@ -6,6 +6,10 @@ from ._version import full_version as __version__ # noqa __requires__ = [ + 'traits', + 'traitsui', + 'pyface', + 'numpy', 'enable', 'six' ] diff --git a/ci/edmtool.py b/ci/edmtool.py index 981f2203a..6931c888d 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -79,13 +79,27 @@ "mock", "numpy", "pandas", + "pyface", "pygments", "pyparsing", + "traits", + "traitsui", "cython", + "enable", # Needed to install enable from source "swig", } +# Dependencies we install from source for cron tests +source_dependencies = { + "enable", + "pyface", + "traits", + "traitsui", +} + +github_url_fmt = "git+http://github.com/enthought/{0}.git#egg={0}" + extra_dependencies = { 'pyside2': set(), # pyside2 is pip-installed during the install step 'pyqt': {'pyqt'}, @@ -114,7 +128,12 @@ def cli(): @click.option('--runtime', default='3.6') @click.option('--toolkit', default='null') @click.option('--environment', default=None) -def install(runtime, toolkit, environment): +@click.option( + "--source/--no-source", + default=False, + help="Install ETS packages from source", +) +def install(runtime, toolkit, environment, source): """ Install project and dependencies into a clean EDM environment. """ parameters = get_parameters(runtime, toolkit, environment) @@ -126,9 +145,6 @@ def install(runtime, toolkit, environment): "edm install -y -e {environment} {packages}", ("edm run -e {environment} -- pip install -r ci/requirements.txt" " --no-dependencies"), - # Note that enable dependencies will be installed implicitly using pip - ("edm run -e {environment} -- " - "pip install git+https://git@github.com/enthought/enable.git"), "edm run -e {environment} -- pip install . --no-deps", ] # pip install pyside2, because we don't have it in EDM yet @@ -139,6 +155,26 @@ def install(runtime, toolkit, environment): click.echo("Creating environment '{environment}'".format(**parameters)) execute(commands, parameters) + + if source: + # Remove EDM ETS packages and install them from source + cmd_fmt = ( + "edm plumbing remove-package " + "--environment {environment} --force " + ) + commands = [cmd_fmt + source_pkg for source_pkg in source_dependencies] + execute(commands, parameters) + source_pkgs = [ + github_url_fmt.format(pkg) for pkg in source_dependencies + ] + commands = [ + "python -m pip install {pkg} --no-deps".format(pkg=pkg) + for pkg in source_pkgs + ] + commands = [ + "edm run -e {environment} -- " + command for command in commands + ] + execute(commands, parameters) click.echo('Done install') From fb5d7a04db39588f4edb97a18e2b2d1d9bf761c5 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Tue, 27 Oct 2020 07:46:58 -0500 Subject: [PATCH 2/3] revert this! setting TRAVIS_EVENT_TYPE='cron' to run cron job on CI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 08033bf87..9ad3a06ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ env: - INSTALL_EDM_VERSION=2.0.0 PYTHONUNBUFFERED="1" QT_DEBUG_PLUGINS="1" + - TRAVIS_EVENT_TYPE='cron' matrix: include: From 6e9caa09c1fa0812a7fb767e49a1ab1881e898f7 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Tue, 27 Oct 2020 09:28:57 -0500 Subject: [PATCH 3/3] Revert "revert this! setting TRAVIS_EVENT_TYPE='cron' to run cron job on CI" This reverts commit fb5d7a04db39588f4edb97a18e2b2d1d9bf761c5. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9ad3a06ef..08033bf87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,6 @@ env: - INSTALL_EDM_VERSION=2.0.0 PYTHONUNBUFFERED="1" QT_DEBUG_PLUGINS="1" - - TRAVIS_EVENT_TYPE='cron' matrix: include: