Skip to content

Commit

Permalink
Merge branch 'develop' into feature/functional_plugin_api
Browse files Browse the repository at this point in the history
  • Loading branch information
Czaki authored Jan 26, 2024
2 parents ad9946a + de43a4f commit a104055
Show file tree
Hide file tree
Showing 47 changed files with 957 additions and 423 deletions.
34 changes: 11 additions & 23 deletions .github/workflows/base_test_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Base Test Workflow

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -40,7 +42,7 @@ jobs:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python ${{ inputs.python_version }}
with:
python-version: ${{ inputs.python_version }}
Expand Down Expand Up @@ -69,7 +71,7 @@ jobs:
- name: Download test data
if: ${{ inputs.test_data }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: test_data
path: test_data
Expand All @@ -80,7 +82,7 @@ jobs:
pip list
- name: Test with tox
uses: aganders3/headless-gui@v1
uses: aganders3/headless-gui@v2
timeout-minutes: ${{ inputs.timeout }}
with:
run: python -m tox ${{ inputs.tox_args }}
Expand All @@ -90,31 +92,17 @@ jobs:
BACKEND: ${{ inputs.qt_backend }}
PIP_CONSTRAINT: requirements/constraints_py${{ inputs.python_version }}.txt

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: upload pytest timing reports as json
name: timing-report-${{ inputs.os }}-py-${{ inputs.python_version }}-${{ inputs.napari }}-${{ inputs.qt_backend }}-${{ inputs.coverage }}
path: |
./report-*.json
retention-days: 7

- uses: actions/upload-artifact@v3
- name: Upload coverage data
uses: actions/upload-artifact@v4
if: ${{ inputs.coverage }}
with:
name: coverage_report ${{ inputs.tox_args }}
name: cov-reports-${{ inputs.os }}-py-${{ inputs.python_version }}-${{ inputs.napari }}-${{ inputs.qt_backend }}
path: |
./htmlcov
retention-days: 7

- uses: codecov/codecov-action@v3
if: ${{ inputs.coverage }}
with:
file: ./coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./coverage.xml
retention-days: 5
./.coverage.*
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -58,7 +58,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -72,4 +72,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

steps:
# Fetch project source with GitHub Actions Checkout.
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Run the "semgrep ci" command on the command line of the docker image.
- run: semgrep ci
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_napari_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- shell: bash
run: bash build_utils/download_data.sh
- name: Upload test data
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test_data
path: test_data
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand All @@ -54,14 +54,14 @@ jobs:
pip install setuptools tox tox-gh-actions
- name: Download test data
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: test_data
path: test_data

- name: Test with tox
# run tests using pip install --pre
uses: aganders3/headless-gui@v1
uses: aganders3/headless-gui@v2
timeout-minutes: 60
with:
run: tox
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test_prereleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- shell: bash
run: bash build_utils/download_data.sh
- name: Upload test data
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test_data
path: test_data
Expand All @@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
Expand All @@ -59,7 +59,7 @@ jobs:
- uses: tlambert03/setup-qt-libs@v1

- name: Download test data
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: test_data
path: test_data
Expand All @@ -71,7 +71,7 @@ jobs:
- name: Test with tox linux
# run tests using pip install --pre
uses: aganders3/headless-gui@v1
uses: aganders3/headless-gui@v2
timeout-minutes: 60
with:
run: python -m tox -v --pre
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python 3.9
with:
python-version: 3.9
Expand All @@ -115,19 +115,19 @@ jobs:
pip-sync
pip install .
- name: upload requirements
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: requirements
path: requirements.txt
- name: Run PyInstaller
run: python build_utils/create_and_pack_executable.py
- name: Upload bundle
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bundle
path: dist2/
- name: Test bundle
uses: aganders3/headless-gui@v1
uses: aganders3/headless-gui@v2
timeout-minutes: 60
with:
run: dist/PartSeg/PartSeg _test
Expand Down
56 changes: 49 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- shell: bash
run: bash build_utils/download_data.sh
- name: Upload test data
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test_data
path: test_data
Expand Down Expand Up @@ -102,8 +102,8 @@ jobs:
uses: ./.github/workflows/base_test_workflow.yml
with:
test_data: True
python_version: "3.8"
tox_args: "-e py38-PyQt5-coverage"
python_version: "3.10"
tox_args: "-e py310-PyQt5-coverage"
coverage: true

test_minimal:
Expand All @@ -116,6 +116,48 @@ jobs:
tox_args: "-e py38-PyQt5-minimal"
coverage: true

coverage_prepare:
name: Prepare coverage
runs-on: ubuntu-latest
needs: [test_coverage, test_minimal]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache-dependency-path: setup.cfg
cache: 'pip'
- name: Install Dependencies
run: |
pip install --upgrade pip
pip install codecov
- name: Download coverage data
uses: actions/download-artifact@v4
with:
pattern: cov-reports-*
path: coverage
merge-multiple: true
- name: combine coverage data
run: |
python -Im coverage combine coverage
python -Im coverage xml -o coverage.xml
# Report and write to summary.
python -Im coverage report --format=markdown --skip-empty --skip-covered >> $GITHUB_STEP_SUMMARY
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage_xml
path: coverage.xml
retention-days: 5

- name: Upload coverage data
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

test_conda:
name: Test PartSeg conda
runs-on: ubuntu-20.04
Expand All @@ -135,7 +177,7 @@ jobs:
- uses: tlambert03/setup-qt-libs@v1

- name: Download test data
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: test_data
path: test_data
Expand All @@ -160,7 +202,7 @@ jobs:
run: bash build_utils/create_environment_yml.sh

- name: Upload environment file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: environment
path: environment.yml
Expand All @@ -171,7 +213,7 @@ jobs:
run: sed -e "s/{sys_platform}/{platform}/g" tox.ini -i

- name: Test with tox
uses: aganders3/headless-gui@v1
uses: aganders3/headless-gui@v2
with:
run: conda run -n test --no-capture-output tox -e py39-PySide2-conda
timeout-minutes: 60
Expand All @@ -184,4 +226,4 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v1
- uses: hynek/build-and-inspect-python-package@v2
9 changes: 5 additions & 4 deletions .github/workflows/upgrade-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ jobs:
ssh-key: ${{ secrets.DEPLOY_KEY }}

# START PYTHON DEPENDENCIES
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: pip
cache-dependency-path: 'setup.cfg'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: pip
cache-dependency-path: 'setup.cfg'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: 'setup.cfg'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
Expand All @@ -53,6 +53,7 @@ jobs:
python${pyv} -m pip install -U pip pip-tools
python${pyv} -m piptools compile --upgrade -o requirements/constraints_py${pyv}.txt setup.cfg requirements/version_denylist.txt ${flags}
done
python3.11 -m piptools compile --upgrade -o requirements/constraints_py3.11_docs.txt setup.cfg requirements/version_denylist.txt --allow-unsafe --strip-extras --extra docs --extra pyqt6
# END PYTHON DEPENDENCIES

- name: Check updated packages
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.1
rev: 23.12.1
hooks:
- id: black
pass_filenames: true
Expand All @@ -25,7 +25,7 @@ repos:
- id: setup-cfg-fmt
args: ["--include-version-classifiers", "--max-py-version", "3.11"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
rev: v0.1.14
hooks:
- id: ruff
- repo: https://github.com/asottile/pyupgrade
Expand All @@ -49,7 +49,7 @@ repos:
- mdformat-toc

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.6.1' # Use the sha / tag you want to point at
rev: 'v1.8.0' # Use the sha / tag you want to point at
hooks:
- id: mypy
files: ^package/PartSegImage/.+\.py
Expand Down
11 changes: 6 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ sphinx:
formats: all

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.11"


# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: requirements/constraints_py3.9.txt
- requirements: requirements/requirements_dev.txt
- requirements: requirements/constraints_py3.11_docs.txt
- method: pip
path: .[docs]
path: .
extra_requirements:
- docs
Loading

0 comments on commit a104055

Please sign in to comment.