From 9a519a275d83276dadd9633e77db6c19f0e2f516 Mon Sep 17 00:00:00 2001 From: Matthieu Dartiailh Date: Wed, 21 Apr 2021 21:42:17 +0200 Subject: [PATCH 1/5] cis: switch to Github actions --- .github/workflows/ci.yml | 72 +++++++++++++++++++++++++++++++++++++ .travis.yml | 77 ---------------------------------------- setup.py | 2 +- 3 files changed, 73 insertions(+), 78 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..3a91a4b5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: Continuous Integration +on: + schedule: + - cron: '0 0 * * 2' + push: + branches: + - main + pull_request: + branches: + - main + paths: + - .github/workflows/ci.yml + - "exopy/**" + - "tests/**" + - setup.py + +jobs: + tests: + name: Unit tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + python-version: [3.7, 3.8, 3.9] + fail-fast: false + steps: + - name: Install linux only test dependency + if: matrix.os == 'ubuntu-latest' + shell: bash + # Install all dependencies needed to run Qt on linux (taken from the qt website + # and completed by adding package marked missing when running with + # QT_DEBUG_PLUGINS=1) + run: | + sudo apt-get update --fix-missing + sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-x11-dev libxcb-xtest0-dev libegl1-mesa xvfb matchbox-window-manager --fix-missing + - name: Checkout branch + uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + - name: Install project + run: | + python setup.py develop + - name: Install pytest + run: | + pip install pytest pytest-cov pytest-qt + - name: Run tests (Windows) + if: matrix.os != 'ubuntu-latest' && matrix.python-version != '3.6' + run: python -X dev -m pytest tests --cov enaml --cov-report xml + - name: Run tests (Linux) + if: matrix.os == 'ubuntu-latest' && matrix.python-version != '3.6' + shell: bash -l {0} + run: | + export DISPLAY=:99.0 + /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset + sleep 3 + matchbox-window-manager & + sleep 1 + python -X dev -m pytest tests --cov exopy --cov-report xml -v --log-cli-level CRITICAL + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + if: matrix.os != 'windows-latest' + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d1fff75f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,77 +0,0 @@ -# References https://gist.github.com/dan-blanchard/7045057 -# and https://docs.travis-ci.com/user/trusty-ci-environment/ - -sudo: false -dist: trusty - -branches: - only: - - master - -matrix: - include: - - env: PYTHON=3.6 CONDA_PY=36 QT_VERSION=5 - - env: PYTHON=3.7 CONDA_PY=37 QT_VERSION=5 - - env: PYTHON=3.8 CONDA_PY=38 QT_VERSION=5 - -before_install: - - # Install Miniconda - - travis_retry wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - chmod +x miniconda.sh - - ./miniconda.sh -b -p ~/anaconda - - export PATH=~/anaconda/bin:$PATH - - # Setup environment - - travis_retry conda update --yes conda - - conda config --set always_yes yes - - conda config --append channels conda-forge - - conda config --append channels exopy - - conda install conda-build anaconda-client -q - - conda info -a - - conda create -n travisci python=$PYTHON pip - - source activate travisci - - CONDA_INSTALL="conda install -q" - - PIP_INSTALL="pip install -q" - - # Setup conda build output directory - - cd ~ - - mkdir conda-bld-out - - cd conda-bld-out - - export CONDA_BLD_PATH=$(pwd) - - # Install exopy dependencies - - $CONDA_INSTALL pyqt=$QT_VERSION numpy configobj watchdog qtawesome pyvisa enaml>=0.11.0 - - # Intall test tools - - $CONDA_INSTALL pytest - - $PIP_INSTALL pytest-cov pytest-timeout pytest-qt - - $PIP_INSTALL https://github.com/MatthieuDartiailh/enaml_coverage_plugin/tarball/master - - # Install codecov report tools - - $PIP_INSTALL codecov - -install: - - # Build exopy conda package and install it (check that build script is not broken) - - cd $TRAVIS_BUILD_DIR - - conda build conda -q # Package building does run only very minimal tests - - conda install exopy --use-local -q - - cd ~ - -before_script: -# I need a (fake) display on Travis so I need to start a X server. -- export DISPLAY=:99.0 -- /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 - -script: - # Run the Exopy test suite - - cd ~ - - export COVERAGE_DATAFILE=$TRAVIS_BUILD_DIR/.coverage - - export QT_API=pyqt$QT_VERSION - - "pytest $TRAVIS_BUILD_DIR/tests -v --log-cli-level CRITICAL --cov exopy --cov-report xml:$TRAVIS_BUILD_DIR/coverage.xml --cov-config $TRAVIS_BUILD_DIR/.coveragerc" - -after_success: - - cd $TRAVIS_BUILD_DIR - - codecov - - if [ "$TRAVIS_PULL_REQUEST" = false ]; then bash continuous-integration/deploy.sh; fi diff --git a/setup.py b/setup.py index 123b1750..48ab42e7 100644 --- a/setup.py +++ b/setup.py @@ -49,9 +49,9 @@ def long_description(): 'Natural Language :: English', 'Operating System :: OS Independent', 'Topic :: Scientific/Engineering :: Physics', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', ], zip_safe=False, packages=find_packages(exclude=['tests', 'tests.*']), From 2eeae1aa22d0941a3e2ed29098dd1b0a84aa20eb Mon Sep 17 00:00:00 2001 From: Matthieu Dartiailh Date: Wed, 21 Apr 2021 21:48:28 +0200 Subject: [PATCH 2/5] cis: add missing test depedency --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a91a4b5..a36521e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,12 +47,13 @@ jobs: python setup.py develop - name: Install pytest run: | - pip install pytest pytest-cov pytest-qt + python -m pip install pytest pytest-cov pytest-qt + python -m pip install https://github.com/MatthieuDartiailh/enaml_coverage_plugin/tarball/master - name: Run tests (Windows) - if: matrix.os != 'ubuntu-latest' && matrix.python-version != '3.6' + if: matrix.os != 'ubuntu-latest' run: python -X dev -m pytest tests --cov enaml --cov-report xml - name: Run tests (Linux) - if: matrix.os == 'ubuntu-latest' && matrix.python-version != '3.6' + if: matrix.os == 'ubuntu-latest' shell: bash -l {0} run: | export DISPLAY=:99.0 From 7bb1ab531bb1e10bd85c6b50f49e2cc232af3426 Mon Sep 17 00:00:00 2001 From: Matthieu Dartiailh Date: Wed, 21 Apr 2021 21:55:51 +0200 Subject: [PATCH 3/5] cis: fix ? --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a36521e0..18679101 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + python -m pip install wheel pyqt5 - name: Install project run: | python setup.py develop From 5468e2c0eba85d236d6f70d5e2bcd4fc7b27967b Mon Sep 17 00:00:00 2001 From: Matthieu Dartiailh Date: Tue, 27 Apr 2021 08:48:59 +0200 Subject: [PATCH 4/5] cis: limit to windows only and try to fix most warning (except resource related ones) --- .github/workflows/ci.yml | 24 ++----------------- docs/source/dev_guide/testing.rst | 4 ++-- exopy/app/errors/manifest.enaml | 3 ++- exopy/app/packages/manifest.enaml | 2 +- exopy/instruments/manifest.enaml | 2 +- exopy/measurement/container.py | 2 +- .../editors/execution_editor/editor.enaml | 3 ++- .../editors/execution_editor/editor_model.py | 3 ++- exopy/measurement/manifest.enaml | 2 +- exopy/measurement/workspace/workspace.py | 2 +- exopy/tasks/tasks/base_tasks.py | 2 +- .../tasks/logic/loop_iterable_interface.py | 2 +- .../tasks/logic/loop_linspace_interface.py | 2 +- exopy/testing/fixtures.py | 10 ++++---- exopy/testing/instruments/fixtures.py | 2 +- exopy/testing/measurement/fixtures.py | 2 +- .../testing/measurement/workspace/fixtures.py | 2 +- exopy/testing/tasks/fixtures.py | 2 +- exopy/utils/mapping_utils.py | 2 +- exopy/utils/widgets/dict_tree_view.enaml | 2 +- tests/app/dependencies/test_plugin.py | 2 +- tests/app/icons/conftest.py | 2 +- tests/conftest.py | 4 ++++ .../engines/test_process_engine.py | 4 ++-- tests/measurement/workspace/test_workspace.py | 2 +- tests/tasks/tasks/test_validators.py | 2 +- 26 files changed, 39 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18679101..a9705ba4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,19 +20,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [windows-latest] python-version: [3.7, 3.8, 3.9] fail-fast: false steps: - - name: Install linux only test dependency - if: matrix.os == 'ubuntu-latest' - shell: bash - # Install all dependencies needed to run Qt on linux (taken from the qt website - # and completed by adding package marked missing when running with - # QT_DEBUG_PLUGINS=1) - run: | - sudo apt-get update --fix-missing - sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-x11-dev libxcb-xtest0-dev libegl1-mesa xvfb matchbox-window-manager --fix-missing - name: Checkout branch uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -48,22 +39,11 @@ jobs: python setup.py develop - name: Install pytest run: | - python -m pip install pytest pytest-cov pytest-qt + python -m pip install pytest pytest-cov pytest-qt pytest-timeout python -m pip install https://github.com/MatthieuDartiailh/enaml_coverage_plugin/tarball/master - name: Run tests (Windows) if: matrix.os != 'ubuntu-latest' run: python -X dev -m pytest tests --cov enaml --cov-report xml - - name: Run tests (Linux) - if: matrix.os == 'ubuntu-latest' - shell: bash -l {0} - run: | - export DISPLAY=:99.0 - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset - sleep 3 - matchbox-window-manager & - sleep 1 - python -X dev -m pytest tests --cov exopy --cov-report xml -v --log-cli-level CRITICAL - - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 if: matrix.os != 'windows-latest' diff --git a/docs/source/dev_guide/testing.rst b/docs/source/dev_guide/testing.rst index 7a3389f2..23692cc0 100644 --- a/docs/source/dev_guide/testing.rst +++ b/docs/source/dev_guide/testing.rst @@ -102,7 +102,7 @@ after the tests. To avoid duplicating a lot of code Pytest provides fixture functions. A fixture function is imply a function decorated with '@pytest.fixture' (or -'@pytest.yield_fixture') which, when passed as argument of a test function, +'@pytest.fixture') which, when passed as argument of a test function, will be called automatically by pytest. Standard fixture simply gives access to a value, yield_fixture allow to cleanup after the test execution. Note that a fixture can rely on another fixture. @@ -113,7 +113,7 @@ fixture can rely on another fixture. def tool(): return 1 - @pytest.yield_fixture + @pytest.fixture def clean_tool(tool): yield tool # This will pass 1 to the test function del tool # This is executed after the test function (no matter the errors) diff --git a/exopy/app/errors/manifest.enaml b/exopy/app/errors/manifest.enaml index e97878cf..f44998b4 100644 --- a/exopy/app/errors/manifest.enaml +++ b/exopy/app/errors/manifest.enaml @@ -11,7 +11,8 @@ """ import logging from pprint import pformat -from collections import defaultdict, Mapping +from collections import defaultdict +from collections.abc import Mapping from enaml.workbench.api import PluginManifest, ExtensionPoint, Extension from enaml.workbench.core.api import Command diff --git a/exopy/app/packages/manifest.enaml b/exopy/app/packages/manifest.enaml index 74726269..383fa6d2 100644 --- a/exopy/app/packages/manifest.enaml +++ b/exopy/app/packages/manifest.enaml @@ -18,7 +18,7 @@ unregistered first). """ import logging -from collections import Mapping +from collections.abc import Mapping from pprint import pformat from enaml.workbench.api import PluginManifest, Extension diff --git a/exopy/instruments/manifest.enaml b/exopy/instruments/manifest.enaml index 1afc350a..a2e54b61 100644 --- a/exopy/instruments/manifest.enaml +++ b/exopy/instruments/manifest.enaml @@ -10,7 +10,7 @@ """ import logging -from collections import Mapping +from collections.abc import Mapping from ast import literal_eval import enaml diff --git a/exopy/measurement/container.py b/exopy/measurement/container.py index 0d49a653..c9733ac2 100644 --- a/exopy/measurement/container.py +++ b/exopy/measurement/container.py @@ -9,7 +9,7 @@ """Specialised container used to store measurements. """ -from collections import Iterable +from collections.abc import Iterable from atom.api import Atom, List, Signal diff --git a/exopy/measurement/editors/execution_editor/editor.enaml b/exopy/measurement/editors/execution_editor/editor.enaml index e3cf4a55..5b9b9665 100644 --- a/exopy/measurement/editors/execution_editor/editor.enaml +++ b/exopy/measurement/editors/execution_editor/editor.enaml @@ -10,7 +10,8 @@ """ from operator import attrgetter -from collections import Iterable, OrderedDict +from collections import OrderedDict +from collections.abc import Iterable from time import sleep from atom.api import Value, Typed diff --git a/exopy/measurement/editors/execution_editor/editor_model.py b/exopy/measurement/editors/execution_editor/editor_model.py index f3e472b6..77948aa9 100644 --- a/exopy/measurement/editors/execution_editor/editor_model.py +++ b/exopy/measurement/editors/execution_editor/editor_model.py @@ -9,7 +9,8 @@ """Model for the execution editor keeping track of the declared pools. """ -from collections import Counter, Iterable +from collections import Counter +from collections.abc import Iterable from atom.api import Atom, Value, Typed, List diff --git a/exopy/measurement/manifest.enaml b/exopy/measurement/manifest.enaml index b1d4e734..8d923ee8 100644 --- a/exopy/measurement/manifest.enaml +++ b/exopy/measurement/manifest.enaml @@ -10,7 +10,7 @@ """ import logging -from collections import Mapping +from collections.abc import Mapping from pprint import pformat import enaml diff --git a/exopy/measurement/workspace/workspace.py b/exopy/measurement/workspace/workspace.py index edcb69e5..965a762e 100644 --- a/exopy/measurement/workspace/workspace.py +++ b/exopy/measurement/workspace/workspace.py @@ -521,7 +521,7 @@ def _insert_new_edition_panels(self, measurements, update=True, if panels is None: template = 'meas_%d' items = self.dock_area.dock_items() - test = re.compile('meas\_([0-9]+)$') + test = re.compile(r'meas\_([0-9]+)$') measurement_items = [i for i in items if test.match(i.name)] ops = [] diff --git a/exopy/tasks/tasks/base_tasks.py b/exopy/tasks/tasks/base_tasks.py index 8a564a35..7ae8bd55 100644 --- a/exopy/tasks/tasks/base_tasks.py +++ b/exopy/tasks/tasks/base_tasks.py @@ -16,7 +16,7 @@ import logging import threading from multiprocessing.synchronize import Event -from collections import Iterable +from collections.abc import Iterable from inspect import cleandoc from textwrap import fill from copy import deepcopy diff --git a/exopy/tasks/tasks/logic/loop_iterable_interface.py b/exopy/tasks/tasks/logic/loop_iterable_interface.py index 4a982bc2..c4b19cf5 100644 --- a/exopy/tasks/tasks/logic/loop_iterable_interface.py +++ b/exopy/tasks/tasks/logic/loop_iterable_interface.py @@ -12,7 +12,7 @@ import numpy as np from atom.api import Str -from collections import Iterable +from collections.abc import Iterable from ..task_interface import TaskInterface from ..validators import Feval diff --git a/exopy/tasks/tasks/logic/loop_linspace_interface.py b/exopy/tasks/tasks/logic/loop_linspace_interface.py index 2aa3be2b..11d94961 100644 --- a/exopy/tasks/tasks/logic/loop_linspace_interface.py +++ b/exopy/tasks/tasks/logic/loop_linspace_interface.py @@ -97,6 +97,6 @@ def perform(self): raw_values = np.linspace(start, stop, num) iterable = np.fromiter((round(value, digit) for value in raw_values), - np.float, len(raw_values)) + np.float64, len(raw_values)) task.write_in_database('loop_values', np.array(iterable)) task.perform_loop(iterable) diff --git a/exopy/testing/fixtures.py b/exopy/testing/fixtures.py index 9051328b..06893bf1 100644 --- a/exopy/testing/fixtures.py +++ b/exopy/testing/fixtures.py @@ -57,7 +57,7 @@ def dialog_sleep(): return DIALOG_SLEEP -@pytest.yield_fixture(scope='session', autouse=True) +@pytest.fixture(scope='session', autouse=True) def sys_path(): """Detect installation path of exopy. @@ -106,7 +106,7 @@ def watchdog_on_travis(): watchdog.observers.Observer = PollingObserver -@pytest.yield_fixture(scope='session') +@pytest.fixture(scope='session') def app(): """Make sure a QtApplication is active. @@ -120,7 +120,7 @@ def app(): yield app -@pytest.yield_fixture +@pytest.fixture def exopy_qtbot(app, qtbot): """Set the enaml application on the bot and add automatic windows cleanup. @@ -130,7 +130,7 @@ def exopy_qtbot(app, qtbot): yield qtbot -@pytest.yield_fixture +@pytest.fixture def app_dir(tmpdir): """Fixture setting the app_directory.ini file for each test. @@ -147,7 +147,7 @@ def app_dir(tmpdir): remove(app_pref) -@pytest.yield_fixture +@pytest.fixture def logger(caplog): """Fixture returning a logger for testing and cleaning handlers afterwards. diff --git a/exopy/testing/instruments/fixtures.py b/exopy/testing/instruments/fixtures.py index c332d6eb..24ede130 100644 --- a/exopy/testing/instruments/fixtures.py +++ b/exopy/testing/instruments/fixtures.py @@ -32,7 +32,7 @@ pytests_plugin = str('exopy.testing.fixtures'), -@pytest.yield_fixture +@pytest.fixture def instr_workbench(workbench, monkeypatch, app_dir, app): """Setup the workbench in such a way that the instrs manager can be tested. diff --git a/exopy/testing/measurement/fixtures.py b/exopy/testing/measurement/fixtures.py index dcfac203..22e3d3b3 100644 --- a/exopy/testing/measurement/fixtures.py +++ b/exopy/testing/measurement/fixtures.py @@ -39,7 +39,7 @@ pytests_plugin = str('exopy.testing.fixtures'), -@pytest.yield_fixture +@pytest.fixture def measurement_workbench(workbench, monkeypatch, app_dir): """Setup the workbench in such a way that the measurement plugin can be tested. diff --git a/exopy/testing/measurement/workspace/fixtures.py b/exopy/testing/measurement/workspace/fixtures.py index 59b4aab5..cec0aafd 100644 --- a/exopy/testing/measurement/workspace/fixtures.py +++ b/exopy/testing/measurement/workspace/fixtures.py @@ -22,7 +22,7 @@ pytests_plugin = str('exopy.testing.measurement.fixtures'), -@pytest.yield_fixture +@pytest.fixture def workspace(exopy_qtbot, measurement_workbench, measurement): """Create a measurement workspace. diff --git a/exopy/testing/tasks/fixtures.py b/exopy/testing/tasks/fixtures.py index 418033c9..e9baf1e4 100644 --- a/exopy/testing/tasks/fixtures.py +++ b/exopy/testing/tasks/fixtures.py @@ -35,7 +35,7 @@ pytests_plugin = str('exopy.testing.fixtures'), -@pytest.yield_fixture +@pytest.fixture def task_workbench(workbench, monkeypatch, app_dir): """Setup the workbench in such a way that the task manager can be tested. diff --git a/exopy/utils/mapping_utils.py b/exopy/utils/mapping_utils.py index 0e0b3bd8..366f786a 100644 --- a/exopy/utils/mapping_utils.py +++ b/exopy/utils/mapping_utils.py @@ -9,7 +9,7 @@ """Mapping related utility functions. """ -from collections import Mapping +from collections.abc import Mapping def recursive_update(to_update, data): diff --git a/exopy/utils/widgets/dict_tree_view.enaml b/exopy/utils/widgets/dict_tree_view.enaml index 7e4e2b9b..2585d642 100644 --- a/exopy/utils/widgets/dict_tree_view.enaml +++ b/exopy/utils/widgets/dict_tree_view.enaml @@ -9,7 +9,7 @@ """Widget used to represent nested dict as a tree. """ -from collections import Mapping +from collections.abc import Mapping from atom.api import Atom, Typed, Value, Str, ForwardTyped, List diff --git a/tests/app/dependencies/test_plugin.py b/tests/app/dependencies/test_plugin.py index d72cb5d9..66ac92ba 100644 --- a/tests/app/dependencies/test_plugin.py +++ b/tests/app/dependencies/test_plugin.py @@ -33,7 +33,7 @@ # --- Fixtures ---------------------------------------------------------------- # ============================================================================= -@pytest.yield_fixture +@pytest.fixture def dep_workbench(workbench): """Setup the workbench to test dependencies related capabilities. diff --git a/tests/app/icons/conftest.py b/tests/app/icons/conftest.py index ba3f384f..808760d9 100644 --- a/tests/app/icons/conftest.py +++ b/tests/app/icons/conftest.py @@ -18,7 +18,7 @@ from exopy.app.icons.manifest import IconManagerManifest -@pytest.yield_fixture +@pytest.fixture def icon_workbench(workbench, app_dir): """Register the icon mannager plugin and dependencies. diff --git a/tests/conftest.py b/tests/conftest.py index 838acfda..cb9807a6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,3 +20,7 @@ 'exopy.testing.measurement.monitors.text_monitor.fixtures', 'exopy.testing.tasks.fixtures') +def pytest_configure(config): + config.addinivalue_line( + "markers", "ui: mark test involving ui display" + ) diff --git a/tests/measurement/engines/test_process_engine.py b/tests/measurement/engines/test_process_engine.py index 68baf38f..82898cfb 100644 --- a/tests/measurement/engines/test_process_engine.py +++ b/tests/measurement/engines/test_process_engine.py @@ -68,7 +68,7 @@ def run(self): self.value = self._engine.perform(self._exec_infos) -@pytest.yield_fixture +@pytest.fixture def process_engine(measurement_workbench): measurement_workbench.register(LogManifest()) measurement_workbench.register(TasksManagerManifest()) @@ -78,7 +78,7 @@ def process_engine(measurement_workbench): gc.collect() -@pytest.yield_fixture +@pytest.fixture def sync_server(): class SyncServer(object): diff --git a/tests/measurement/workspace/test_workspace.py b/tests/measurement/workspace/test_workspace.py index 2af7e9a1..d1a25e59 100644 --- a/tests/measurement/workspace/test_workspace.py +++ b/tests/measurement/workspace/test_workspace.py @@ -23,7 +23,7 @@ from exopy.testing.measurement.contributions import Flags -@pytest.yield_fixture +@pytest.fixture def workspace(exopy_qtbot, measurement_workbench, measurement): """Create a measurement workspace. diff --git a/tests/tasks/tasks/test_validators.py b/tests/tasks/tasks/test_validators.py index b585d77c..c61c9c56 100644 --- a/tests/tasks/tasks/test_validators.py +++ b/tests/tasks/tasks/test_validators.py @@ -21,7 +21,7 @@ from exopy.testing.tasks.util import CheckTask -@pytest.yield_fixture +@pytest.fixture def task(): """Create a task to test the validators. From a0eda6c4f105f4728284540cd46fd84053e97629 Mon Sep 17 00:00:00 2001 From: Matthieu Dartiailh Date: Tue, 27 Apr 2021 14:32:12 +0200 Subject: [PATCH 5/5] drop tools to build conda packages since nobody seem to be using them anyway --- conda/bld.bat | 5 --- conda/build.sh | 5 --- conda/meta.yaml | 50 ------------------------- continuous-integration/anaconda-push.py | 29 -------------- continuous-integration/deploy.sh | 8 ---- exopy/utils/declarator.py | 2 +- 6 files changed, 1 insertion(+), 98 deletions(-) delete mode 100644 conda/bld.bat delete mode 100644 conda/build.sh delete mode 100644 conda/meta.yaml delete mode 100644 continuous-integration/anaconda-push.py delete mode 100644 continuous-integration/deploy.sh diff --git a/conda/bld.bat b/conda/bld.bat deleted file mode 100644 index 2fd48e3d..00000000 --- a/conda/bld.bat +++ /dev/null @@ -1,5 +0,0 @@ -python setup.py install --single-version-externally-managed --record=NUL --no-compile -if errorlevel 1 exit 1 - -del %SCRIPTS%\enaml-run.exe* -if errorlevel 1 exit 1 diff --git a/conda/build.sh b/conda/build.sh deleted file mode 100644 index 25e57190..00000000 --- a/conda/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --single-version-externally-managed --record=/dev/null --no-compile - -rm $PREFIX/bin/easy_* diff --git a/conda/meta.yaml b/conda/meta.yaml deleted file mode 100644 index f1ecbe84..00000000 --- a/conda/meta.yaml +++ /dev/null @@ -1,50 +0,0 @@ -package: - name: exopy - version: {{ environ.get('GIT_DESCRIBE_TAG', '') + - ( '' if environ.get('GIT_DESCRIBE_NUMBER', '0') == '0' else - ('.post' + environ.get('GIT_DESCRIBE_NUMBER', '0' ) - ) - )}} - -source: - path: .. - -build: - number: {{ environ.get('GIT_DESCRIBE_NUMBER', 1) }} - entry_points: - - exopy = exopy.__main__:main - osx_is_app: True - -requirements: - host: - - python - - pyqt >=5 # Add PyQt so that it does not appear in the package requires - # which avoids issues when extension packages depending on exopy - # check that all their dependencies are present. - run: - - python - - python.app [osx] - - enaml >=0.10.2 - - pyqt >=5 - - atom >=0.4.1 - - kiwisolver >=1.0.0 - - watchdog - - configobj - - qtawesome - - numpy - -test: - commands: - - exopy --help - imports: - - exopy - -app: - entry: exopy - summary: 'Exopy application' - -about: - home: https://github.com/Exopy/exopy - license: BSD - license_file: LICENSE - summary: High level experiment automation program diff --git a/continuous-integration/anaconda-push.py b/continuous-integration/anaconda-push.py deleted file mode 100644 index 87b6ba7d..00000000 --- a/continuous-integration/anaconda-push.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -"""Push all conda packages found in a directory to anaconda.org - -""" -import os -import glob -import subprocess -import traceback - - -def upload(): - """Invoke anaconda client to upload conda packages. - - """ - token = os.environ['ANACONDA_TOKEN'] - cmd = ['anaconda', '-t', token, 'upload', '--force'] - packages = [] - for anchor in ('noarch', 'linux-64', 'osx-64', 'win-32', 'win-64'): - packages.extend(glob.glob(anchor + '/*.tar.bz2')) - print('Found packages are :\n', packages) - cmd.extend(packages) - try: - subprocess.check_call(cmd) - except subprocess.CalledProcessError: - traceback.print_exc() - -if __name__ == '__main__': - upload() diff --git a/continuous-integration/deploy.sh b/continuous-integration/deploy.sh deleted file mode 100644 index ed887555..00000000 --- a/continuous-integration/deploy.sh +++ /dev/null @@ -1,8 +0,0 @@ -set -e -cd $TRAVIS_BUILD_DIR -PACK="$(conda build conda --output)" -conda convert $PACK -p osx-64 -p win-64 --quiet -o $CONDA_BLD_PATH -conda convert $PACK -p win-32 --quiet -o $CONDA_BLD_PATH -cd $CONDA_BLD_PATH -source deactivate -python $TRAVIS_BUILD_DIR/continuous-integration/anaconda-push.py diff --git a/exopy/utils/declarator.py b/exopy/utils/declarator.py index a49890a2..36075576 100644 --- a/exopy/utils/declarator.py +++ b/exopy/utils/declarator.py @@ -87,7 +87,7 @@ def __str__(self): raise NotImplementedError() -PATH_VALIDATOR = re.compile('^(\.?\w+)*$') +PATH_VALIDATOR = re.compile(r'^(\.?\w+)*$') class GroupDeclarator(Declarator):