Skip to content
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b80d734
move clone to subdirectory
Czaki Oct 13, 2023
43f16e2
constraint path
Czaki Oct 13, 2023
80fddbc
try use $GITHUB_WORKSPACE
Czaki Oct 13, 2023
d247d90
try github.workspace
Czaki Oct 13, 2023
ed2cae1
re add version hack
Czaki Oct 13, 2023
f3fdb82
fix typo in wheel build workflow
Czaki Oct 13, 2023
c819f26
try workflow for test multiple napari version
Czaki Oct 13, 2023
c84a40a
add name
Czaki Oct 13, 2023
ab99a68
call from pull_request test
Czaki Oct 13, 2023
20f1f1e
fix typo
Czaki Oct 13, 2023
97b50bd
Merge branch 'main' into feature/test_against_napari
Czaki Oct 25, 2023
a6f3e00
add support for passing `command pre` using env variable
Czaki Oct 25, 2023
488f998
fix indendation
Czaki Oct 25, 2023
d5985c4
remove deps
Czaki Oct 25, 2023
b846ae0
try to pass COMMAND PRE
Czaki Oct 25, 2023
a510ed9
use test branch
Czaki Oct 25, 2023
0953d82
chek "\n"
Czaki Oct 25, 2023
771bfc2
use path instead of name
Czaki Oct 25, 2023
6278f75
use `main_test` branch
Czaki Oct 25, 2023
6b8b896
parent directory
Czaki Oct 25, 2023
0288780
try isolated mode
Czaki Oct 25, 2023
45336fa
skip pip list
Czaki Oct 25, 2023
5ddd2cc
proper tag for package
Czaki Oct 25, 2023
69a72b8
use actions/checkout default mechanism
Czaki Oct 25, 2023
d95d1c2
fix selection of repository
Czaki Oct 25, 2023
e2191c9
fix testing on pull request
Czaki Oct 25, 2023
7235c2c
add option to pass pytest path
Czaki Oct 25, 2023
90b9b2f
bug reproduce
Czaki Oct 29, 2023
d63e82a
add aditional guard
Czaki Oct 29, 2023
556e59d
protect package_to_test_ref
Czaki Oct 29, 2023
07dcf13
fix default repository
Czaki Oct 29, 2023
efb5f0e
use v0.4.19.x branch
Czaki Oct 29, 2023
2fdf740
pass extra args
Czaki Oct 29, 2023
23ca86d
fix name
Czaki Oct 29, 2023
d143d37
try fetch tags
Czaki Oct 29, 2023
bcbacf6
better workflow name
Czaki Oct 29, 2023
e56aea3
pass PYTEST_EXTRA_ARGS
Czaki Nov 6, 2023
3e44e70
Merge remote-tracking branch 'napari/main' into feature/test_against_…
Czaki Nov 6, 2023
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
63 changes: 50 additions & 13 deletions .github/workflows/reusable_run_tox_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ on:
required: false
type: string
default: ""
package_to_test:
required: false
type: string
default: ""
package_to_test_ref:
required: false
type: string
default: ""
napari_version:
required: false
type: string
default: ""
pytest_path:
required: false
type: string
default: ""




jobs:
test:
Expand All @@ -47,14 +66,30 @@ jobs:
PYVISTA_OFF_SCREEN: True
MIN_REQ: ${{ inputs.min_req }}
FORCE_COLOR: 1
PIP_CONSTRAINT: resources/constraints/constraints_py${{ inputs.python_version }}${{ inputs.min_req && '_min_req' }}${{ inputs.constraints_suffix }}.txt
PIP_CONSTRAINT: ${{ github.workspace }}/napari_repo/resources/constraints/constraints_py${{ inputs.python_version }}${{ inputs.min_req && '_min_req' }}${{ inputs.constraints_suffix }}.txt
COVERAGE: ${{ inputs.coverage }}
TOX_WORK_DIR: .tox
TOX_EXTRAS: ${{ inputs.tox_extras }}
INSTALL_PKG: ${{ inputs.package_to_test == '' && '--installpkg dist/napari-0.0.1-py3-none-any.whl' || '' }}
COMMAND_PRE: ${{ inputs.package_to_test != '' && 'pip install --isolated ../package_to_test' || '' }}
PYTEST_PATH: ${{ inputs.pytest_path }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: napari_repo
ref: ${{ inputs.napari_version }}
repository: ${{ inputs.package_to_test != '' && 'napari/napari' || '' }}

- uses: actions/checkout@v4
if: ${{ inputs.package_to_test != '' }}
with:
path: package_to_test
ref: ${{ inputs.package_to_test_ref }}
repository: ${{ inputs.package_to_test }}
fetch-depth: 0

- uses: actions/download-artifact@v3
if: ${{ inputs.package_to_test == '' }}
with:
name: wheel
path: dist
Expand All @@ -64,7 +99,7 @@ jobs:
with:
python-version: ${{ inputs.python_version }}
cache: "pip"
cache-dependency-path: setup.cfg
cache-dependency-path: napari_repo/setup.cfg

- uses: tlambert03/setup-qt-libs@v1

Expand All @@ -91,8 +126,8 @@ jobs:
- name: create _version.py file
# workaround for not using src layout
run: |
echo "__version__ = version = '0.5.0a2.dev364'" > napari/_version.py
echo "__version_tuple__ = version_tuple = (0, 5, 0, 'dev364', '')" >> napari/_version.py
echo "__version__ = version = '0.5.0a2.dev364'" > napari_repo/napari/_version.py
echo "__version_tuple__ = version_tuple = (0, 5, 0, 'dev364', '')" >> napari_repo/napari/_version.py

# here we pass off control of environment creation and running of tests to tox
# tox-gh-actions, installed above, helps to convert environment variables into
Expand All @@ -114,10 +149,12 @@ jobs:
# FOURTH=none
shell: bash
run: |
python tools/split_qt_backend.py 0 ${{ inputs.qt_backend }} >> $GITHUB_ENV
python tools/split_qt_backend.py 1 ${{ inputs.qt_backend }} >> $GITHUB_ENV
python tools/split_qt_backend.py 2 ${{ inputs.qt_backend }} >> $GITHUB_ENV
python tools/split_qt_backend.py 3 ${{ inputs.qt_backend }} >> $GITHUB_ENV
ls napari_repo
ls napari_repo/tools
python napari_repo/tools/split_qt_backend.py 0 ${{ inputs.qt_backend }} >> $GITHUB_ENV
python napari_repo/tools/split_qt_backend.py 1 ${{ inputs.qt_backend }} >> $GITHUB_ENV
python napari_repo/tools/split_qt_backend.py 2 ${{ inputs.qt_backend }} >> $GITHUB_ENV
python napari_repo/tools/split_qt_backend.py 3 ${{ inputs.qt_backend }} >> $GITHUB_ENV

- name: Test with tox main
timeout-minutes: ${{ inputs.timeout }}
Expand All @@ -126,7 +163,7 @@ jobs:
shell: bash
run: |
echo ${{ env.MAIN }}
python -m tox run --installpkg dist/napari-0.0.1-py3-none-any.whl
python -m tox run $INSTALL_PKG -c napari_repo/tox.ini
rm -r .tox
env:
BACKEND: ${{ env.MAIN }}
Expand All @@ -139,7 +176,7 @@ jobs:
with:
shell: bash
run: |
python -m tox run --installpkg dist/napari-0.0.1-py3-none-any.whl
python -m tox run $INSTALL_PKG -c napari_repo/tox.ini
rm -r .tox
env:
BACKEND: ${{ env.SECOND }}
Expand All @@ -152,7 +189,7 @@ jobs:
with:
shell: bash
run: |
python -m tox run --installpkg dist/napari-0.0.1-py3-none-any.whl
python -m tox run $INSTALL_PKG -c napari_repo/tox.ini
rm -r .tox
env:
BACKEND: ${{ env.THIRD }}
Expand All @@ -165,7 +202,7 @@ jobs:
with:
shell: bash
run: |
python -m tox run --installpkg dist/napari-0.0.1-py3-none-any.whl
python -m tox run $INSTALL_PKG -c napari_repo/tox.ini
rm -r .tox
env:
BACKEND: ${{ env.FOURTH }}
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/test_external_package_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test external package compatibility against main and last release

on:
pull_request:
paths:
- ".github/workflows/reusable_tox_run.yml"
- ".github/workflows/test_external_package_compatibility.yml"
workflow_call:
inputs:
package_to_test:
required: false
type: string
default: ""
package_to_test_ref:
required: false
type: string
default: ""
python_version:
required: false
type: string
default: "3.10"
platform:
required: false
type: string
default: "ubuntu-latest"
backend:
required: false
type: string
default: "headless"
pytest_path:
required: false
type: string
default: ""
Comment on lines +9 to +33
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlambert03 Here is the full list that could be specified.

It includes backend, platform, python_version and pytest_path where pytest_path is passed as environment variable to tox and then placed in pytest command.


jobs:
test:
name: Initial test
uses: ./.github/workflows/reusable_run_tox_test.yml
strategy:
fail-fast: false
matrix:
include:
- python: ${{ inputs.python_version }}
platform: ${{ inputs.platform }}
backend: ${{ inputs.backend }}
napari_version: "main_test"
- python: ${{ inputs.python_version }}
platform: ${{ inputs.platform }}
backend: ${{ inputs.backend }}
napari_version: "v0.4.19x_test"
with:
python_version: ${{ matrix.python }}
platform: ${{ matrix.platform }}
qt_backend: ${{ matrix.backend }}
coverage: no_cov
package_to_test: ${{ github.event_name == 'pull_request' && 'napari/npe2' || inputs.package_to_test == '' && github.repository || inputs.package_to_test }}
package_to_test_ref: ${{ github.event_name == 'pull_request' && 'main' || inputs.package_to_test_ref }}
napari_version: ${{ matrix.napari_version }}
pytest_path: ${{ inputs.pytest_path }}
10 changes: 10 additions & 0 deletions .github/workflows/test_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,13 @@ jobs:
asv run --show-stderr --quick --attribute timeout=300 HEAD^!
env:
PR: 1

test_external_test:
name: tmp run test external package
uses: ./.github/workflows/test_external_package_workflow.yml
with:
package_to_test: "napari/npe2"
package_to_test_ref: "main"
python_version: "3.10"
platform: "ubuntu-latest"
backend: "headless"
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ indexserver =
# we use Spec 4 index server that contain nightly wheel.
# this will be used only when using --pre with tox/pip as it only contains nightly.
extra = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
commands_pre =
{env:COMMAND_PRE:}
commands =
echo "COVERAGE: {env:COVERAGE:}"
cov: coverage run \
Expand All @@ -108,6 +110,7 @@ commands =

[testenv:py{38,39,310,311}-{linux,macos,windows}-headless-{cov,no_cov}]
commands_pre =
{[testenv]commands_pre}
pip uninstall -y pytest-qt qtpy pyqt5 pyside2 pyside6 pyqt6

commands =
Expand Down