Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully move to Pydantic v2 #793

Merged
merged 58 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
27a00c3
force pydantic > 2
Jul 15, 2024
b6b645a
migrate channels model
Jul 15, 2024
376f060
naive transition to v2
Jul 16, 2024
a310cee
fix: test_NgffImageMetadata failing because of non-unique multiscales…
Jul 16, 2024
b0bb171
fix missing None in NapariInputModel Optionals
Jul 16, 2024
564a1c0
fix more Optionals without explicit None
Jul 16, 2024
7d255f3
fix: fix mismatched Validation error
Jul 16, 2024
40640f7
fix: fix more basic validation errors
Jul 16, 2024
c0b9e26
fix: cellpose validation
Jul 16, 2024
150ea04
update changelog
Jul 16, 2024
7449848
Merge branch 'main' of github.com:fractal-analytics-platform/fractal-…
Jul 16, 2024
17bb816
merge main
Jul 16, 2024
7521165
fix: Avoid direct Self imports for 3.9 compatibility
Jul 16, 2024
7654ff0
fix: revert erroneous move
Jul 16, 2024
697c1d0
udpate .dict methods to .model_dump
Jul 16, 2024
5f3e4c0
update .copy to .model_copy
Jul 16, 2024
fbf3cf9
Provisionally restore `.dict()` in cellpose task to simplify merge fr…
tcompa Jul 17, 2024
5741d31
Merge branch 'main' into pydantic-v2-second-attempt
tcompa Jul 17, 2024
fee52d4
REVERT: Provisionally restore `.dict()` in cellpose task to simplify …
tcompa Jul 17, 2024
bb6e051
In-progress: Update of JSON schema tools to pydantic v1/v2
tcompa Jul 17, 2024
552cd1b
Include `pydantic-v2-second-attempt` target for CI
tcompa Jul 17, 2024
0b4ee7d
Do not include fractal-tasks-core Pydantic models, when using pydanti…
tcompa Jul 17, 2024
5e4e374
Add FIXME
tcompa Jul 17, 2024
b17c779
Change logging level
tcompa Jul 17, 2024
593bc11
Stop supporting Pydantic-V1 JSON-Schema generation (ref #802)
tcompa Jul 19, 2024
ed73234
Update manifest
tcompa Jul 19, 2024
c7a60d0
Update some `pydantic_v1` labels left in dev tools
tcompa Jul 19, 2024
aec104f
Update tests
tcompa Jul 19, 2024
24fbc90
Also handle custom models with no docstring
tcompa Jul 19, 2024
81d8481
poetry remove pytest-pretty
tcompa Jul 19, 2024
725ffe9
Fix test_valid_args_schemas
tcompa Jul 19, 2024
afe3770
Restore `.github/workflows/ci_poetry.yml` [skip ci]
tcompa Jul 19, 2024
393171e
Remove comment [skip ci]
tcompa Jul 19, 2024
f3628e7
Add assertions to test_otional_argument
tcompa Jul 19, 2024
dbd93b3
Update CHANGELOG [skip ci]
tcompa Jul 19, 2024
d2a2a69
Merge pull request #801 from fractal-analytics-platform/pydantic-v2-s…
tcompa Jul 19, 2024
22ef80b
Add `None` default in task model
tcompa Jul 19, 2024
e34421f
Improve GHA comments [skip ci]
tcompa Jul 19, 2024
701f0e7
Update CHANGELOG [skip ci]
tcompa Jul 19, 2024
7c5cbfb
Always install `fractal-tasks` extra when building manifest of extern…
tcompa Jul 19, 2024
b73ade5
Fix GHA comment
tcompa Jul 19, 2024
d547688
Use new branch for APX
tcompa Jul 22, 2024
ffe881e
Specify branch for external packages
tcompa Jul 22, 2024
99ddc2a
Do not use `devtools` in manifest building phase
tcompa Jul 22, 2024
4597aee
Add cleanup to GHA
tcompa Jul 22, 2024
07340cf
Do not install pytorch within GHA
tcompa Jul 22, 2024
99f90bd
Fix GHA
tcompa Jul 22, 2024
013fbf1
Clarify docstring [skip ci]
tcompa Jul 22, 2024
09b76b2
Test validator when `coordinateTransformations=None`
tcompa Jul 22, 2024
e3401f7
Test new `unique_items_validator`
tcompa Jul 22, 2024
ef6976a
Extract pydantic-v2 JSON-Schema tools into separate module
tcompa Jul 22, 2024
418fd6b
Merge branch 'main' into pydantic-v2-second-attempt
tcompa Jul 22, 2024
3163521
Update CHANGELOG [skip ci]
tcompa Jul 22, 2024
acec6a0
Fix `generate_zarr_ones.py` and `plate_ones.zarr`
tcompa Jul 23, 2024
5e8354f
Remove comment [skip ci]
tcompa Jul 23, 2024
7fb8750
Update `test_enum_arguments.py` to pydantic v2
tcompa Jul 23, 2024
ab18a4c
Update `test_create_schema_for_single_task.py` to pydantic v2
tcompa Jul 23, 2024
2aed673
Add test_tuple_argument
tcompa Jul 23, 2024
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
29 changes: 29 additions & 0 deletions .github/workflows/manifest_external_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,46 @@ jobs:

package: [skip]
github_repo: [skip]
github_branch: [skip]
manifest_path: [skip]
cmd_install: [skip]
cmd_create_manifest: [skip]
custom_dependencies: [skip]

include:

- package: scMultipleX
github_repo: fmi-basel/gliberal-scMultipleX
github_branch: main
manifest_path: src/scmultiplex/__FRACTAL_MANIFEST__.json
cmd_install: 'python -m pip install -e .[fractal-tasks]'
cmd_create_manifest: 'python src/scmultiplex/dev/create_manifest.py'
custom_dependencies: 'image_registration'

- package: fractal-helper-tasks
github_repo: jluethi/fractal-helper-tasks
github_branch: main
manifest_path: src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json
cmd_install: 'python -m pip install -e .'
cmd_create_manifest: 'python src/fractal_helper_tasks/dev/create_manifest.py'
custom_dependencies: ''

- package: APx_fractal_task_collection
github_repo: Apricot-Therapeutics/APx_fractal_task_collection
github_branch: pydantic_v2
manifest_path: src/apx_fractal_task_collection/__FRACTAL_MANIFEST__.json
cmd_install: 'python -m pip install -e .'
cmd_create_manifest: 'python src/apx_fractal_task_collection/dev/update_manifest.py'
custom_dependencies: ''

exclude:
- package: skip
github_repo: skip
github_branch: skip
manifest_path: skip
cmd_install: skip
cmd_create_manifest: skip
custom_dependencies: skip

steps:

Expand All @@ -63,6 +73,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: ${{ matrix.github_repo }}
ref: ${{ matrix.github_branch }}

- uses: actions/setup-python@v5
with:
Expand All @@ -75,11 +86,29 @@ jobs:
- name: Install package
run: ${{ matrix.cmd_install }}

- name: Get current branch of `fractal-tasks-core`
uses: actions/checkout@v4
with:
path: fractal-tasks-core

- name: Install current fractal-tasks-core (this may fail)
run: python -m pip install -e ./fractal-tasks-core

- name: Install custom additional dependencies (see issue 803)
if: ${{ matrix.custom_dependencies != '' }}
run: python -m pip install ${{ matrix.custom_dependencies }}

- name: Create manifest
run: ${{ matrix.cmd_create_manifest }}

- name: Setup friendly diff style
run: echo "*.json diff=json" >> .gitattributes && git config diff.json.textconv "jq --sort-keys '.' \$1"

- name: Run git diff for manifest
run: git diff ${{ matrix.manifest_path }}

- name: Clean up before checking repo status
run: rm -rf fractal-tasks-core .gitattributes

- name: Check repo status
run: if [[ -z $(git status -s) ]]; then echo "Clean status"; else echo "Dirty status"; git status; exit 1; fi
20 changes: 16 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
**Note**: Numbers like (\#123) point to closed Pull Requests on the fractal-tasks-core repository.

# 1.2.0 (unreleased)

* Core-library and tasks:
* Switch all core models to Pydantic V2 (\#793).
* JSON Schema generation tools:
* Move JSON-Schema tools to Pydantic V2 (\#793).
* Testing:
* Remove dependency on `pytest-pretty` (\#793).
* Update `manifest_external_packages.yml` GitHub Action so that it installs the current `fractal-tasks-core` (\#793).

# 1.1.1

* Tasks:
* Fix issue with masked ROI & relabeling in Cellpose task (\#785).
* Fix issue with masking ROI label types in `masked_loading_wrapper` for Cellpose task (\#785).
* Fix issue with masked ROI & relabeling in Cellpose task (\#786).
* Fix issue with masking ROI label types in `masked_loading_wrapper` for Cellpose task (\#786).
* Enable workaround to support yx images in Cellpose task (\#789).
* Fix error handling in `calculate_registration_image_based` (\#799).
* Fix minor issues with call-signature and type hints in `calculate_registration_image_based` (\#799).
Expand All @@ -22,8 +32,8 @@
* Refactor Cellpose Task inputs: Support independent normalization of 2 input channels in the Cellpose task (\#738).
* Rename `task.cellpose_transforms` into `tasks.cellpose_utils` (\#738).
* Fix wrong repeated overlap checks for bounding-boxes in Cellpose task (\#778).
* Fix minor MIP issues related to plate metadata and expecting acquisition metadata in all NGFF plates(\#781).
* Add `chi2_shift` option to Calculate Registration (image-based) task(\#741).
* Fix minor MIP issues related to plate metadata and expecting acquisition metadata in all NGFF plates (\#781).
* Add `chi2_shift` option to Calculate Registration (image-based) task (\#741).
* Development:
* Switch to transitional pydantic.v1 imports, changes pydantic requirement to `==1.10.16` or `>=2.6.3` (\#760).
* Support JSON-Schema generation for `Enum` task arguments (\#749).
Expand All @@ -35,6 +45,8 @@
* Test manifest creation for three other tasks packages (\#763).
* NGFF subpackage
* Fix Plate model to correspond better to 0.4.0 NGFF spec: Now makes acquisition metadata optional (\#781).
* Dependencies:
* Add `image_registration` within `fractal-tasks` extra (\#741).

# 1.0.2

Expand Down
Loading
Loading