From 9f0a37abd4d4c358976617e64855de5321566ac6 Mon Sep 17 00:00:00 2001 From: Ziwen Liu <67518483+ziw-liu@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:45:24 -0700 Subject: [PATCH] Bump Python, iohub, and waveorder (#478) * update iohub dependency * bump waveorder * update workflow and format yaml * bump python * bump tox env * update workflow * remove unused arguments * prepare to unpin pydantic --------- Co-authored-by: Aaron Alvarez --- .github/workflows/pytests.yml | 53 +++++++++++------------ .github/workflows/test_and_deploy.yml | 4 +- recOrder/cli/apply_inverse_models.py | 5 +-- recOrder/cli/settings.py | 2 +- recOrder/tests/cli_tests/test_settings.py | 2 +- setup.cfg | 9 ++-- tox.ini | 4 +- 7 files changed, 38 insertions(+), 41 deletions(-) diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index 722bc244..290932b8 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -7,38 +7,37 @@ on: [push] jobs: build: - runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.9', '3.10', '3.11'] + python-version: ["3.10", "3.11", "3.12"] steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install ".[acq,dev]" - -# - name: Lint with flake8 -# run: | -# pip install flake8 -# # stop the build if there are Python syntax errors or undefined names -# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide -# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Test with pytest - run: | - pytest -v - pytest --cov=./ --cov-report=xml + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ".[acq,dev]" + + # - name: Lint with flake8 + # run: | + # pip install flake8 + # # stop the build if there are Python syntax errors or undefined names + # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Test with pytest + run: | + pytest -v + pytest --cov=./ --cov-report=xml # - name: Upload coverage to Codecov # uses: codecov/codecov-action@v1 diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 8d6421ad..ea717550 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: platform: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.9', '3.10', '3.11'] + python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 @@ -85,4 +85,4 @@ jobs: # run: | # git tag # python -m build . -# twine upload --repository testpypi dist/* # Commented until API key is on github \ No newline at end of file +# twine upload --repository testpypi dist/* # Commented until API key is on github diff --git a/recOrder/cli/apply_inverse_models.py b/recOrder/cli/apply_inverse_models.py index fab04eec..98de1b03 100644 --- a/recOrder/cli/apply_inverse_models.py +++ b/recOrder/cli/apply_inverse_models.py @@ -1,6 +1,7 @@ """ This module converts recOrder's reconstructions into waveorder calls """ + import numpy as np import torch from waveorder.models import ( @@ -99,8 +100,6 @@ def phase( real_potential_transfer_function, imaginary_potential_transfer_function, z_padding=settings_phase.transfer_function.z_padding, - z_pixel_size=settings_phase.transfer_function.z_pixel_size, - wavelength_illumination=settings_phase.transfer_function.wavelength_illumination, **settings_phase.apply_inverse.dict(), ) @@ -213,8 +212,6 @@ def birefringence_and_phase( real_potential_transfer_function, imaginary_potential_transfer_function, z_padding=settings_phase.transfer_function.z_padding, - z_pixel_size=settings_phase.transfer_function.z_pixel_size, - wavelength_illumination=settings_phase.transfer_function.wavelength_illumination, **settings_phase.apply_inverse.dict(), ) diff --git a/recOrder/cli/settings.py b/recOrder/cli/settings.py index 16a0da1e..a7661fd9 100644 --- a/recOrder/cli/settings.py +++ b/recOrder/cli/settings.py @@ -1,7 +1,7 @@ import os from typing import List, Literal, Optional, Union -from pydantic import ( +from pydantic.v1 import ( BaseModel, Extra, NonNegativeFloat, diff --git a/recOrder/tests/cli_tests/test_settings.py b/recOrder/tests/cli_tests/test_settings.py index 4e37bc19..7a425d45 100644 --- a/recOrder/tests/cli_tests/test_settings.py +++ b/recOrder/tests/cli_tests/test_settings.py @@ -1,7 +1,7 @@ import pytest from recOrder.cli import settings from recOrder.io import utils -from pydantic import ValidationError +from pydantic.v1 import ValidationError def test_reconstruction_settings(): diff --git a/setup.cfg b/setup.cfg index a6cb7f5c..d22fec2e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,9 +11,9 @@ classifiers = License :: OSI Approved :: BSD License Programming Language :: Python Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Topic :: Scientific/Engineering Topic :: Scientific/Engineering :: Visualization Topic :: Scientific/Engineering :: Information Analysis @@ -33,17 +33,18 @@ project_urls = [options] packages = find: include_package_data = True -python_requires = >=3.9 +python_requires = >=3.10 setup_requires = setuptools_scm install_requires = - waveorder==2.0.0rc3 + waveorder==2.2.0rc0 click>=8.0.1 natsort>=7.1.1 colorspacious>=1.1.2 importlib-metadata - iohub==0.1.0.dev5 + iohub==0.1.0 wget>=3.2 psutil + pydantic>=1.10.17 [options.extras_require] dev = diff --git a/tox.ini b/tox.ini index c9cb7c17..842e7352 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,14 @@ # Modified from from cookiecutter-napari-plugin # For more information about tox, see https://tox.readthedocs.io/en/latest/ [tox] -envlist = py{39,310,311}-{linux,macos,windows} +envlist = py{310,311,312}-{linux,macos,windows} isolated_build=true [gh-actions] python = - 3.9: py39 3.10: py310 3.11: py311 + 3.12: py312 [gh-actions:env] PLATFORM =