diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml new file mode 100644 index 00000000..e1cb42d8 --- /dev/null +++ b/.github/workflows/posix.yml @@ -0,0 +1,47 @@ +name: Build for Linux + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +jobs: + test: + name: ${{ matrix.platform }} ${{ matrix.python-version }} + runs-on: ${{ matrix.platform }} + + strategy: + fail-fast: false + matrix: + platform: [ubuntu-latest, macos-latest] + python-version: [3.6, 3.7, 3.8] + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup miniconda + - uses: goanpeca/setup-miniconda@v1.6.0 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + environment-file: environment.yml + + - name: Install Linux dependencies + if: matrix.platform == 'ubuntu-latest' + run: | + sudo apt install libxkbcommon-x11-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 + + - name: Install dependencies + shell: bash -l {0} + run: | + python -m pip install --upgrade pip wheel pytest tox .[napari] + + - name: Run pytest + shell: bash -l {0} + run: pytest diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 89acc262..304bc218 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -15,6 +15,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.x + environment-file: environment.yml - name: Clone gl-ci-helpers run: git clone --depth 1 git://github.com/vtkiorg/gl-ci-helpers.git @@ -27,6 +28,5 @@ jobs: shell: bash run: > export PATH="/c/Python37:/c/Python37/Scripts:$PATH" && - python -m pip install --upgrade pip wheel pytest tox scikit-image - .[napari] && + python -m pip install --upgrade pip wheel pytest tox .[napari] && pytest diff --git a/.travis.yml b/.travis.yml index cdfa1ee9..ba5d5ac9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,15 +4,10 @@ dist: bionic language: python jobs: include: - - name: Python36 - python: "3.6" - - name: Python37 - python: "3.7" - - name: Python38 - python: "3.8" - stage: deploy python: "3.6" if: tag IS present + install: skip script: skip skip_cleanup: true deploy: @@ -22,15 +17,3 @@ jobs: distributions: sdist bdist_wheel on: tags: true - -# command to install dependencies -install: - - pip install .[napari] - - pip install scikit-image # only needed for tests - -# command to run tests -script: pytest - -cache: - directories: - - $HOME/.cache/pip diff --git a/environment.yml b/environment.yml new file mode 100644 index 00000000..744e42ea --- /dev/null +++ b/environment.yml @@ -0,0 +1,26 @@ +#name: z +channels: + - defaults + - ome + - conda-forge +dependencies: + - pyqt >=5.12.3 + - napari + - flake8 + - ipython + - mypy + - omero-py + - opencv + - pip + - py-opencv + - pytest + - python.app + - requests + - s3fs + - scikit-image + - scipy + - xarray + - zarr >= 2.4.0 + - pip: + - pre-commit + - pytest-qt diff --git a/setup.py b/setup.py index 8046f06f..dcfee440 100644 --- a/setup.py +++ b/setup.py @@ -49,5 +49,5 @@ def read(fname): "pytest11": ["napari-conftest = napari.conftest"], }, extras_require={"napari": ["napari"]}, - tests_require=["pytest", "pytest-capturelog"], + tests_require=["pytest"], )