Skip to content

Fix cron job not installing additional dependencies#544

Merged
kitchoi merged 1 commit into
masterfrom
fix-cron-setup
Dec 1, 2020
Merged

Fix cron job not installing additional dependencies#544
kitchoi merged 1 commit into
masterfrom
fix-cron-setup

Conversation

@kitchoi
Copy link
Copy Markdown
Contributor

@kitchoi kitchoi commented Dec 1, 2020

Currently the cron job testing against master of traits/traitsui/pyface/enable is failing with this:

======================================================================
ERROR: chaco.tests.test_array_or_none (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: chaco.tests.test_array_or_none
Traceback (most recent call last):
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/pyface/base_toolkit.py", line 73, in <module>
    import importlib.metadata as importlib_metadata
ModuleNotFoundError: No module named 'importlib.metadata'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/chaco/tests/test_array_or_none.py", line 7, in <module>
    from chaco.axis import PlotAxis
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/chaco/axis.py", line 11, in <module>
    from enable.api import ColorTrait, LineStyle
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/enable/api.py", line 12, in <module>
    from .enable_traits import basic_sequence_types, sequence_types, pointer_shapes, \
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/enable/enable_traits.py", line 12, in <module>
    from traitsui.api import ImageEnumEditor, EnumEditor
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/traitsui/api.py", line 21, in <module>
    from .basic_editor_factory import BasicEditorFactory
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/traitsui/basic_editor_factory.py", line 24, in <module>
    from .editor_factory import EditorFactory
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/traitsui/editor_factory.py", line 33, in <module>
    from .toolkit import toolkit_object
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/traitsui/toolkit.py", line 26, in <module>
    from pyface.base_toolkit import Toolkit, find_toolkit
  File "/home/travis/.edm/envs/chaco-test-3.6-null/lib/python3.6/site-packages/pyface/base_toolkit.py", line 75, in <module>
    import importlib_metadata
ModuleNotFoundError: No module named 'importlib_metadata'

This is because pyface master now requires importlib_metadata. Those dependencies are included in setup.py, but our CI command is installing sources with --no-deps flag.

This PR alters the pip install commands and force reinstall source dependencies with their dependencies.

This is a cheap band aid for fixing the cron job on Travis CI. We may want to rework the cron job setup such that independent workflows are truly independent of each other.

@rahulporuri
Copy link
Copy Markdown
Contributor

running > edm run -e bootstrap -- python .\ci\edmtool.py install --toolkit pyqt5 --source locally on a windows machine gives the following error, which is a known issue :

    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\rporuri\.edm\envs\chaco-test-3.6-pyqt5\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\rporuri\\AppData\\Local\\Temp\\pip-install-oamge7dm\\enable\\setup.py'"'"'; __file__='"'"'C:\\Users\\rporuri\\AppData\\Local\\Temp\\pip-install-oamge7dm\\enable\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\rporuri\AppData\Local\Temp\pip-record-qerocp2p\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\rporuri\.edm\envs\chaco-test-3.6-pyqt5\Include\enable'
         cwd: C:\Users\rporuri\AppData\Local\Temp\pip-install-oamge7dm\enable\
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\rporuri\AppData\Local\Temp\pip-install-oamge7dm\enable\setup.py", line 35, in <module>
        from numpy.distutils.core import setup
      File "C:\Users\rporuri\.edm\envs\chaco-test-3.6-pyqt5\lib\site-packages\numpy\__init__.py", line 305, in <module>
        _win_os_check()
      File "C:\Users\rporuri\.edm\envs\chaco-test-3.6-pyqt5\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check
        raise RuntimeError(msg.format(__file__)) from None
    RuntimeError: The current Numpy installation ('C:\\Users\\rporuri\\.edm\\envs\\chaco-test-3.6-pyqt5\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://tinyurl.com/y3dm3h86
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\rporuri\.edm\envs\chaco-test-3.6-pyqt5\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\rporuri\\AppData\\Local\\Temp\\pip-install-oamge7dm\\enable\\setup.py'"'"'; __file__='"'"'C:\\Users\\rporuri\\AppData\\Local\\Temp\\pip-install-oamge7dm\\enable\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\rporuri\AppData\Local\Temp\pip-record-qerocp2p\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\rporuri\.edm\envs\chaco-test-3.6-pyqt5\Include\enable' Check the logs for full command output.

@kitchoi
Copy link
Copy Markdown
Contributor Author

kitchoi commented Dec 1, 2020

running > edm run -e bootstrap -- python .\ci\edmtool.py install --toolkit pyqt5 --source locally on a windows machine gives the following error, which is a known issue :

Thanks for testing.

Given that is specific to particular versions of Windows and that there is a workaround to install NumPy 1.19.3, Windows users affected by the issue can install NumPy 1.19.3 in their environment first before installing enable. With that, I believe enable should NOT be pinning or restricting the requirement on NumPy version for this platform specific issue: This allows such workaround to take place when needed.

Copy link
Copy Markdown
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rahulporuri
Copy link
Copy Markdown
Contributor

Given that is specific to particular versions of Windows and that there is a workaround to install NumPy 1.19.3, Windows users affected by the issue can install NumPy 1.19.3 in their environment first before installing enable. With that, I believe enable should NOT be pinning or restricting the requirement on NumPy version for this platform specific issue: This allows such workaround to take place when needed.

yeah. i agree. i don't see a good/clean way to work around this in our ci utils.

@kitchoi kitchoi merged commit 4a66835 into master Dec 1, 2020
@kitchoi kitchoi deleted the fix-cron-setup branch December 1, 2020 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants