From 8396f9ee97216a6a0454f0f1d956048d8db42822 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 30 Apr 2024 10:41:51 -0400 Subject: [PATCH 1/2] MAINT: Fix CIs --- environment.yml | 2 +- pyvistaqt/rwi.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 2765a99f..0e46fb72 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: pyvistaqt-env channels: - conda-forge dependencies: - - python<3.9 + - python - codecov - ipython - mypy diff --git a/pyvistaqt/rwi.py b/pyvistaqt/rwi.py index dcfe5306..9730b8ab 100644 --- a/pyvistaqt/rwi.py +++ b/pyvistaqt/rwi.py @@ -475,6 +475,8 @@ def resizeEvent(self, ev): scale = self._getPixelRatio() w = int(round(scale*self.width())) h = int(round(scale*self.height())) + if self._RenderWindow is None: + return self._RenderWindow.SetDPI(int(round(72*scale))) vtkRenderWindow.SetSize(self._RenderWindow, w, h) self._Iren.SetSize(w, h) From b2fb107b81a45eabeec33bbb2a7080a719b1e9d8 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 30 Apr 2024 12:58:56 -0400 Subject: [PATCH 2/2] FIX: Bye Azure --- .ci/azure-pipelines.yml | 204 ---------------------------------- .ci/setup_headless_display.sh | 5 - 2 files changed, 209 deletions(-) delete mode 100644 .ci/azure-pipelines.yml delete mode 100755 .ci/setup_headless_display.sh diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml deleted file mode 100644 index e38c0c86..00000000 --- a/.ci/azure-pipelines.yml +++ /dev/null @@ -1,204 +0,0 @@ -variables: - ALLOW_PLOTTING: true - SHELLOPTS: "errexit:pipefail" - -trigger: - branches: - include: - - "*" - exclude: - - "*no-ci*" - tags: - include: - - "*" - -pr: - branches: - include: - - "*" - exclude: - - "*no-ci*" - -stages: - - stage: Check - jobs: - - job: Skip - pool: - vmImage: "ubuntu-latest" - variables: - DECODE_PERCENTS: "false" - RET: "true" - BUILD_REASON: $(Build.Reason) - steps: - - bash: | - git_log=`git log --format=oneline -n 1 --skip=1` - echo "##vso[task.setvariable variable=log]$git_log" - - bash: echo "##vso[task.setvariable variable=RET]false" - condition: and(eq(variables.BUILD_REASON, 'PullRequest'), or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'))) - - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" - name: result - - - stage: Test - condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) - dependsOn: Check - jobs: - # DESCRIPTION: Core API and doc string testing for Linux - - job: Linux - pool: - vmImage: "ubuntu-latest" - variables: - DISPLAY: ":99.0" - PYVISTA_OFF_SCREEN: "True" - - strategy: - matrix: - Python310: - python.version: "3.10" - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: "$(python.version)" - displayName: "Use Python $(python.version)" - - - script: | - pip install wheel --upgrade - python setup.py bdist_wheel - pip install dist/pyvistaqt*.whl - displayName: Build wheel and install pyvistaqt - - - script: | - .ci/setup_headless_display.sh - displayName: Install headless display - - - script: | - sudo apt-get install python3-tk - pip install -r requirements_test.txt - pip install PyQt5==5.12.* - python -c "import pyvista; print(pyvista.Report())" - which python - pip list - displayName: "Install dependencies" - - - script: | - pip install pytest-azurepipelines - pytest -v --cov pyvistaqt --cov-report xml - displayName: "Test Core API" - - - script: | # this must be right after the core API - bash <(curl -s https://codecov.io/bash) - displayName: "Upload coverage to codecov.io" - - - script: | - pytest -v --doctest-modules pyvistaqt - displayName: "Test Package Docstrings" - - # DESCRIPTION: Core API and doc string testing across VTK versions using conda - - job: LinuxConda - pool: - vmImage: "ubuntu-latest" - variables: - DISPLAY: ":99.0" - PYVISTA_OFF_SCREEN: "True" - steps: - - script: | - .ci/setup_headless_display.sh - displayName: Install headless display - - - script: | - export CONDA_ALWAYS_YES=1 - source /usr/share/miniconda/etc/profile.d/conda.sh - conda config --add channels conda-forge - conda env create --quiet -n pyvistaqt-env --file environment.yml - conda activate pyvistaqt-env - pip install PyQt5==5.12.* - pip install -e . - conda list - which python - python -c "import pyvista; print(pyvista.Report())" - displayName: Create Anaconda environment - - - script: | - source /usr/share/miniconda/etc/profile.d/conda.sh - conda activate pyvistaqt-env - pytest -v --cov pyvistaqt --cov-report html - displayName: "Test Core API against VTK" - - - script: | # this must be right after the core API - bash <(curl -s https://codecov.io/bash) - displayName: "Upload coverage to codecov.io" - - - script: | - source /usr/share/miniconda/etc/profile.d/conda.sh - conda activate pyvistaqt-env - pytest -v --doctest-modules pyvistaqt - displayName: "Test Package Docstrings against VTK" - - # DESCRIPTION: Core API testing for Windows - - job: Windows - pool: - vmIMage: "windows-2019" - strategy: - maxParallel: 4 - matrix: - Python310-64bit: - PYTHON_VERSION: "3.10" - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - addToPath: true - - powershell: | - Set-StrictMode -Version Latest - $ErrorActionPreference = "Stop" - $PSDefaultParameterValues['*:ErrorAction']='Stop' - git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git - powershell gl-ci-helpers/appveyor/install_opengl.ps1 - displayName: "Install OpenGL" - - script: | - python -m pip install -r requirements_test.txt - displayName: "Install test dependencies" - - script: | - pip install PyQt5>=5.11 - python -m pip install -e . - python -c "import pyvista; print(pyvista.Report())" - displayName: "Install PyVista" - - script: | - pytest -v --cov pyvistaqt --cov-report html - displayName: "Run Tests" - - - bash: | - bash <(curl -s https://codecov.io/bash) - displayName: "Upload coverage to codecov.io" - - # DESCRIPTION: Core API testing for MacOS - - job: MacOS - variables: - python.architecture: "x64" - strategy: - matrix: - Python310: - python.version: "3.10" - pool: - vmImage: "macOS-11" - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: "$(python.version)" - displayName: "Get Python" - - - script: | - python -m pip install PyQt5>=5.11 - python -m pip install -e . - python -c "import pyvista; print(pyvista.Report())" - displayName: "Install pyvistaqt" - - - script: | - python -m pip install -r requirements_test.txt - python -m pip install pytest-azurepipelines - python -m pytest -v --cov pyvistaqt --cov-report html --durations=0 - displayName: "Run Tests" - - - script: | - bash <(curl -s https://codecov.io/bash) - displayName: "Upload coverage to codecov.io" diff --git a/.ci/setup_headless_display.sh b/.ci/setup_headless_display.sh deleted file mode 100755 index a41d9638..00000000 --- a/.ci/setup_headless_display.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -ef - -sudo apt update -sudo apt install -yqq libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxcb-shape0 libopengl0 libegl1 -/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset