From 267f747984d9b8fb0e8d5bf910f14a627ab76ec9 Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Mon, 23 Jan 2023 14:37:06 +0000 Subject: [PATCH 1/6] Add Python 3.8 tests. --- .github/workflows/test-with-edm-3.8.yml | 80 +++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/test-with-edm-3.8.yml diff --git a/.github/workflows/test-with-edm-3.8.yml b/.github/workflows/test-with-edm-3.8.yml new file mode 100644 index 000000000..316040722 --- /dev/null +++ b/.github/workflows/test-with-edm-3.8.yml @@ -0,0 +1,80 @@ +# This workflow targets stable released dependencies from EDM. +# Note that some packages may not actually be installed from EDM but from +# PyPI, see ci/edmtool.py implementations. + +name: Test with EDM + +on: pull_request + +env: + INSTALL_EDM_VERSION: 3.5.0 + +jobs: + + # Test against EDM packages on Linux + test-edm-linux: + strategy: + matrix: + toolkit: ['null', 'pyside6'] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Qt dependencies for Linux + run: | + sudo apt-get update + sudo apt-get install libegl1 + sudo apt-get install libxkbcommon-x11-0 + sudo apt-get install libglu1-mesa-dev + 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 + # Needed to work around https://bugreports.qt.io/browse/PYSIDE-1547 + sudo apt-get install libopengl0 + if: matrix.toolkit != 'null' + - name: Cache EDM packages + uses: actions/cache@v2 + with: + path: ~/.cache + key: ${{ runner.os }}-3.8-${{ matrix.toolkit }}-${{ hashFiles('ci/edmtool.py') }} + - name: Setup EDM + uses: enthought/setup-edm-action@v1 + with: + edm-version: ${{ env.INSTALL_EDM_VERSION }} + - name: Install click to the default EDM environment + run: edm install -y wheel click coverage + - name: Install test environment + run: edm run -- python ci/edmtool.py install --toolkit=${{ matrix.toolkit }} + - name: Flake8 + run: edm run -- python ci/edmtool.py flake8 --toolkit=${{ matrix.toolkit }} + if: matrix.toolkit == 'null' + - name: Run tests + run: xvfb-run --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} + + # Test against EDM packages on Windows and OSX + test-with-edm: + strategy: + matrix: + os: [macos-latest, windows-latest] + toolkit: ['null', 'pyside6'] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Cache EDM packages + uses: actions/cache@v2 + with: + path: ~/.cache + key: ${{ runner.os }}-3.8-${{ matrix.toolkit }}-${{ hashFiles('ci/edmtool.py') }} + - name: Setup EDM + uses: enthought/setup-edm-action@v1 + with: + edm-version: ${{ env.INSTALL_EDM_VERSION }} + - name: Install click to the default EDM environment + run: edm install -y wheel click coverage + - name: Install test environment + run: edm run -- python ci/edmtool.py install --toolkit=${{ matrix.toolkit }} + - name: Run tests + run: edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} From 14b3a43e8c900f6d6c3d58e3b1185363cc18080c Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Mon, 23 Jan 2023 14:53:38 +0000 Subject: [PATCH 2/6] Updated edmtool, pyproject, etc. for Python 3.8 --- .github/workflows/test-with-edm-3.8.yml | 8 ++++---- ci/edmtool.py | 7 +++++-- pyproject.toml | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-with-edm-3.8.yml b/.github/workflows/test-with-edm-3.8.yml index 316040722..e6e9676e3 100644 --- a/.github/workflows/test-with-edm-3.8.yml +++ b/.github/workflows/test-with-edm-3.8.yml @@ -47,9 +47,9 @@ jobs: - name: Install click to the default EDM environment run: edm install -y wheel click coverage - name: Install test environment - run: edm run -- python ci/edmtool.py install --toolkit=${{ matrix.toolkit }} + run: edm run -- python ci/edmtool.py install --runtime=3.8 --toolkit=${{ matrix.toolkit }} - name: Flake8 - run: edm run -- python ci/edmtool.py flake8 --toolkit=${{ matrix.toolkit }} + run: edm run -- python ci/edmtool.py flake8 --runtime=3.8 --toolkit=${{ matrix.toolkit }} if: matrix.toolkit == 'null' - name: Run tests run: xvfb-run --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} @@ -75,6 +75,6 @@ jobs: - name: Install click to the default EDM environment run: edm install -y wheel click coverage - name: Install test environment - run: edm run -- python ci/edmtool.py install --toolkit=${{ matrix.toolkit }} + run: edm run -- python ci/edmtool.py install --runtime=3.8 --toolkit=${{ matrix.toolkit }} - name: Run tests - run: edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} + run: edm run -- python ci/edmtool.py test --runtime=3.8 --toolkit=${{ matrix.toolkit }} diff --git a/ci/edmtool.py b/ci/edmtool.py index 118ec605a..948ca9068 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -77,7 +77,8 @@ import click supported_combinations = { - '3.6': {'pyside2', 'pyqt', 'pyqt5', 'null'}, + '3.6': {'pyside2', 'pyqt5', 'null'}, + '3.8': {'pyside6', 'null'}, } dependencies = { @@ -111,6 +112,7 @@ extra_dependencies = { 'pyside2': {'pyside2'}, + 'pyside6': {'pyside6'}, 'pyqt': {'pyqt'}, 'pyqt5': {'pyqt5'}, 'null': set() @@ -161,6 +163,7 @@ environment_vars = { 'pyside2': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyside2'}, + 'pyside6': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyside6'}, 'pyqt': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyqt'}, 'pyqt5': {'ETS_TOOLKIT': 'qt4', 'QT_API': 'pyqt5'}, 'null': {'ETS_TOOLKIT': 'null.image'}, @@ -204,7 +207,7 @@ def install(runtime, toolkit, environment, editable, source): | ci_dependencies ) - if toolkit == "pyside2": + if toolkit.startswith("pyside"): addn_repositories = "--add-repository enthought/lgpl" else: addn_repositories = "" diff --git a/pyproject.toml b/pyproject.toml index b1256a319..26b1ea674 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["cython", "oldest-supported-numpy", "setuptools", "wheel"] +requires = ["cython", "oldest-supported-numpy", "setuptools<65.2", "wheel"] build-backend = "setuptools.build_meta" [tool.cibuildwheel] From 58fcf731e26af71006f8c96b865fdde888e5ae7f Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Mon, 23 Jan 2023 15:05:26 +0000 Subject: [PATCH 3/6] sphinx-copybutton is now available via EDM --- ci/edmtool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/edmtool.py b/ci/edmtool.py index 948ca9068..dbd8ddb1f 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -96,7 +96,7 @@ "swig", } -pypi_dependencies = {"sphinx-copybutton"} +pypi_dependencies = {} # Dependencies we install from source for cron tests # Order from packages with the most dependencies to one with the least @@ -120,7 +120,8 @@ doc_dependencies = { "sphinx", - "enthought_sphinx_theme" + "enthought_sphinx_theme", + "sphinx-copybutton", } doc_ignore = { From e92fba2b3a4418756eaeb1ef7f29a956365c94ce Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Mon, 23 Jan 2023 15:13:06 +0000 Subject: [PATCH 4/6] Missing runtime argument. --- .github/workflows/test-with-edm-3.8.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-with-edm-3.8.yml b/.github/workflows/test-with-edm-3.8.yml index e6e9676e3..df1002daf 100644 --- a/.github/workflows/test-with-edm-3.8.yml +++ b/.github/workflows/test-with-edm-3.8.yml @@ -2,7 +2,7 @@ # Note that some packages may not actually be installed from EDM but from # PyPI, see ci/edmtool.py implementations. -name: Test with EDM +name: Test with EDM on Python 3.8 on: pull_request @@ -12,7 +12,7 @@ env: jobs: # Test against EDM packages on Linux - test-edm-linux: + test-edm-linux-3.8: strategy: matrix: toolkit: ['null', 'pyside6'] @@ -52,10 +52,10 @@ jobs: run: edm run -- python ci/edmtool.py flake8 --runtime=3.8 --toolkit=${{ matrix.toolkit }} if: matrix.toolkit == 'null' - name: Run tests - run: xvfb-run --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --toolkit=${{ matrix.toolkit }} + run: xvfb-run --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --runtime=3.8 --toolkit=${{ matrix.toolkit }} # Test against EDM packages on Windows and OSX - test-with-edm: + test-with-edm-3.8: strategy: matrix: os: [macos-latest, windows-latest] From 1b381f6b1c10cab7291887ea10a4a48d741bc263 Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Mon, 23 Jan 2023 15:15:12 +0000 Subject: [PATCH 5/6] Name actions correctly. --- .github/workflows/test-with-edm-3.8.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-with-edm-3.8.yml b/.github/workflows/test-with-edm-3.8.yml index df1002daf..19c5cfd61 100644 --- a/.github/workflows/test-with-edm-3.8.yml +++ b/.github/workflows/test-with-edm-3.8.yml @@ -12,7 +12,7 @@ env: jobs: # Test against EDM packages on Linux - test-edm-linux-3.8: + test-edm-linux-38: strategy: matrix: toolkit: ['null', 'pyside6'] @@ -55,7 +55,7 @@ jobs: run: xvfb-run --server-args="-screen 0 1024x768x24" edm run -- python ci/edmtool.py test --runtime=3.8 --toolkit=${{ matrix.toolkit }} # Test against EDM packages on Windows and OSX - test-with-edm-3.8: + test-with-edm-38: strategy: matrix: os: [macos-latest, windows-latest] From 5a1c8d1e5e4225dd669ea94aace1ebdf10398e7c Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Mon, 23 Jan 2023 15:37:07 +0000 Subject: [PATCH 6/6] Use np.resize(x, ...) instead of x.resize(...) --- chaco/plot_containers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chaco/plot_containers.py b/chaco/plot_containers.py index 7ee0046e6..f5eaa4df4 100644 --- a/chaco/plot_containers.py +++ b/chaco/plot_containers.py @@ -18,6 +18,7 @@ array, cumsum, hstack, + resize, sum, zeros, zeros_like, @@ -182,7 +183,7 @@ class GridPlotContainer(BasePlotContainer): # The internal component grid, in row-major order. This gets updated # when any of the following traits change: shape, components, grid_components - _grid = Array + _grid = Array() _cached_total_size = Any _h_size_prefs = Any @@ -510,7 +511,7 @@ def _reflow_layout(self): numrows, numcols = divmod(len(self.components), self.shape[0]) self.shape = (numrows, numcols) grid = array(self.components, dtype=object) - grid.resize(self.shape) + grid = resize(grid, self.shape) grid[grid == 0] = None self._grid = grid self._layout_needed = True