Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore CI to working state #1007

Merged
merged 16 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/bleeding-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,33 @@ jobs:
test-ets:
strategy:
matrix:
os: [ubuntu-20.04]
toolkit: ['pyside6', 'pyside2', 'wx']
os: [ubuntu-latest]
toolkit: ['pyside6', 'pyside2']
python-version: [3.8]
runs-on: ${{ matrix.os }}
steps:
- name: Check out
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install PySide2 (from PyPI) dependencies for Linux
run: |
sudo apt-get update
sudo apt-get install qt5-default
sudo apt-get install qtbase5-dev
sudo apt-get install qtchooser
sudo apt-get install qt5-qmake
sudo apt-get install qtbase5-dev-tools
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-icccm4
sudo apt-get install libxcb-image0
sudo apt-get install libxcb-keysyms1
sudo apt-get install libxcb-randr0
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-xinerama0
sudo apt-get install libxcb-shape0
if: matrix.toolkit != 'wx'
- name: Install Wx dependencies for Linux
run: |
Expand Down Expand Up @@ -62,19 +67,14 @@ jobs:
- name: Run enable test suite
env:
PYTHONFAULTHANDLER: 1
uses: GabrielBB/xvfb-action@v1
with:
# kiva agg requires at least 15-bit color depth.
# The --server-args assumes xvfb-run is called, hence Linux only.
run: --server-args="-screen 0 1024x768x24" python -m unittest discover -v enable
working-directory: ${{ runner.temp }}
# kiva agg requires at least 15-bit color depth.
run: xvfb-run --server-args="-screen 0 1024x768x24" python -m unittest discover -v enable
working-directory: ${{ runner.temp }}
- name: Run kiva test suite
env:
PYTHONFAULTHANDLER: 1
uses: GabrielBB/xvfb-action@v1
with:
run: python -m unittest discover -v kiva
working-directory: ${{ runner.temp }}
run: xvfb-run python -m unittest discover -v kiva
working-directory: ${{ runner.temp }}

notify-on-failure:
needs: test-ets
Expand Down
29 changes: 19 additions & 10 deletions .github/workflows/test-with-edm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,38 @@ name: Test with EDM
on: pull_request

env:
INSTALL_EDM_VERSION: 3.2.1
INSTALL_EDM_VERSION: 3.5.0

jobs:

# Test against EDM packages on Linux
test-edm-linux:
strategy:
matrix:
toolkit: ['null', 'pyqt5', 'pyside2', 'wx']
toolkit: ['null', 'pyqt5', 'pyside2']
runtime: ['3.6']
include:
- toolkit: 'pyside6'
runtime: '3.8'
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Qt dependencies for Linux
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev
sudo apt-get install qtchooser
sudo apt-get install qt5-qmake
sudo apt-get install qtbase5-dev-tools
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-icccm4
sudo apt-get install libxcb-image0
sudo apt-get install libxcb-keysyms1
sudo apt-get install libxcb-randr0
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-xinerama0
sudo apt-get install libxcb-shape0
if: matrix.toolkit != 'wx'
- name: Install Wx dependencies for Linux
run: |
Expand All @@ -41,19 +53,16 @@ jobs:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ matrix.runtime }}-${{ hashFiles('ci/edmtool.py') }}
- name: Setup EDM
uses: enthought/setup-edm-action@v1
uses: enthought/setup-edm-action@v2
with:
edm-version: ${{ env.INSTALL_EDM_VERSION }}
- name: Install click to the default EDM environment
run: edm --config ci/.edm.yaml install -y wheel click coverage
- name: Install test environment
run: edm run -- python ci/edmtool.py install --toolkit=${{ matrix.toolkit }} --runtime=${{ matrix.runtime }}
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
# kiva agg requires at least 15-bit color depth.
# The --server-args assumes xvfb-run is called, hence Linux only.
run: --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} --runtime=${{ matrix.runtime }}
# kiva agg requires at least 15-bit color depth.
run: xvfb-run --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} --runtime=${{ matrix.runtime }}

# Test against EDM packages on Windows and OSX
test-with-edm:
Expand Down
1 change: 1 addition & 0 deletions ci/.edm.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
store_url: https://packages.enthought.com
repositories:
- enthought/free
- enthought/lgpl
2 changes: 1 addition & 1 deletion ci/edmtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def install(runtime, toolkit, environment, source):
elif sys.platform == "linux":
# XXX this is mainly for TravisCI workers; need a generic solution
commands.append(
"edm run -e {environment} -- pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04/ wxPython<4.1" # noqa: E501
"edm run -e {environment} -- pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04/ wxPython" # noqa: E501
)
else:
commands.append(
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements_3.6.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pygarrayimage
pyglet
pyglet<2.0
4 changes: 2 additions & 2 deletions ci/requirements_3.8.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pygarrayimage
pyglet
pypdf2
pyglet<2.0
pypdf2<3.0
reportlab
4 changes: 2 additions & 2 deletions enable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Dependencies for running enable/kiva's examples
"examples": ["chaco", "mayavi", "scipy", "kiwisolver", "pyglet"],
# Dependencies for GL backend support
"gl": ["pygarrayimage", "pyglet"],
"gl": ["pygarrayimage", "pyglet<2.0"],
# Dependencies for constrained layout
"layout": ["kiwisolver"],
# Dependencies for PDF backend
Expand All @@ -34,7 +34,7 @@
"svg": ["pyparsing"],
# Dependencies purely for running tests.
"test": [
"PyPDF2", # for pdf drawing tests in kiva.
"PyPDF2<3.0", # for pdf drawing tests in kiva.
"setuptools",
],
}
9 changes: 6 additions & 3 deletions enable/savage/svg/tests/test_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
#
# Thanks for using Enthought open source!

from io import StringIO
from io import BytesIO, StringIO
import unittest
from unittest.mock import patch
import xml.etree.cElementTree as etree

import enable.savage.svg.document as document
Expand Down Expand Up @@ -62,8 +63,10 @@ def testOpacityClampLow(self):
self.document.state["fill-opacity"] = -100
self.assertEqual(self.document.getBrushFromState().color[-1], 0)

def testURLFallback(self):
self.document.state["fill"] = "url(http://google.com) red"
@patch('urllib.request.urlopen')
def testURLFallback(self, mock_urlopen):
mock_urlopen.return_value = BytesIO(b"<!doctype html><html></html>")
self.document.state["fill"] = "url(http://example.com) red"
self.assertEqual(
self.document.getBrushFromState().color, (255, 0, 0, 255)
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["cython", "oldest-supported-numpy", "setuptools", "swig", "wheel"]
requires = ["cython", "oldest-supported-numpy", "setuptools<65.2", "swig", "wheel"]
build-backend = "setuptools.build_meta"