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

refactor: Migrate Python projects from Pydantic v1 to v2 #14871

Merged
merged 143 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
c2d17fb
update pydantic & fix all mypy errors
ahiuchingau Apr 4, 2024
cae6028
hardware: update pydantic & fix all mypy errors
ahiuchingau Apr 4, 2024
8779c87
hardware: fix Pipfile
ahiuchingau Apr 4, 2024
19f7110
api: update pydantic & fix mypy errors
ahiuchingau Apr 4, 2024
b5c8eab
shared-data: add Vec3f
ahiuchingau Apr 5, 2024
ac77352
shared-data: rename labware_definition to models
ahiuchingau Apr 5, 2024
ef889d4
fix api mypy test errors
ahiuchingau Apr 9, 2024
b3ea918
update api
ahiuchingau Apr 9, 2024
ea9e17e
fix protocol_engine tests
ahiuchingau Apr 9, 2024
90b7fab
fix(api): tests
ahiuchingau Apr 9, 2024
16b69eb
update command schema 8.json
ahiuchingau Apr 9, 2024
528a825
shared-data: deprecate json_encoder and use v2 serializer
ahiuchingau Apr 10, 2024
ff83a57
fix api tests
ahiuchingau Apr 10, 2024
80a7000
api(src): update deprecated code
ahiuchingau Apr 10, 2024
1291aa1
api: linter
ahiuchingau Apr 11, 2024
27bbbec
shared-data: remove deprecated code
ahiuchingau Apr 11, 2024
b646339
shared-data: mypy.ini removed commented out override
ahiuchingau Apr 11, 2024
7588a3f
robot-server & server-utils: update pipenv
ahiuchingau Apr 11, 2024
0b391da
robot-server: add pydantic_settings
ahiuchingau Apr 11, 2024
8114936
robot-server: bump-pydantic to v2
ahiuchingau Apr 11, 2024
52b5899
robot-server: fix lint errors
ahiuchingau Apr 12, 2024
9b02831
robot-server: fix one test
ahiuchingau Apr 12, 2024
2728cca
make lint
ahiuchingau Apr 12, 2024
c47cb10
add model serializer
ahiuchingau Apr 19, 2024
82d5a51
Merge remote-tracking branch 'origin/edge' into chore_update-pydantic-v2
SyntaxColoring May 22, 2024
96b4591
Post-merge code fixups.
SyntaxColoring May 22, 2024
68fa893
Re-lock performance-metrics.
SyntaxColoring May 22, 2024
86623ea
Use == version spec for robot-server, like we had before.
SyntaxColoring May 23, 2024
eac19cb
Remove outdated comment.
SyntaxColoring May 23, 2024
7e1da8d
Update g-code-testing Pipfile.
SyntaxColoring May 23, 2024
8ed4c1e
Update system-server Pipfile.
SyntaxColoring May 23, 2024
913019f
Move performance-metrics from api [dev-packages] to [packages].
SyntaxColoring May 23, 2024
2938afb
Re-lock api.
SyntaxColoring May 23, 2024
2b7d068
_TestCommand.result and ReloadLabware.result need to default to None.
SyntaxColoring May 23, 2024
ac00d02
Revert SyncClient model_validate() changes.
SyntaxColoring May 23, 2024
10aa798
Remove now-unneeded type-ignores.
SyntaxColoring May 23, 2024
fef7108
Don't instantiate BaseModel directly.
SyntaxColoring May 23, 2024
a7a69d7
Merge branch 'chore_update-pydantic-v2' of github.com:Opentrons/opent…
SyntaxColoring May 23, 2024
46b024b
Regenerate command schema.
SyntaxColoring May 23, 2024
7d73026
Delete empty log.txt.
SyntaxColoring May 23, 2024
14bc816
Update .json() calls in cli.analyze.
SyntaxColoring May 23, 2024
8dbe3d8
Run bump-pydantic on api.
SyntaxColoring May 24, 2024
d975c0e
Give up on test_command_executor.py.
SyntaxColoring May 23, 2024
e677a7e
Pin fastapi with == like we had before.
SyntaxColoring May 24, 2024
3771b91
Ensure all fastapi pins consistently use 0.100.0.
SyntaxColoring May 24, 2024
ec14dd7
Move robot-server's dependency on performance-metrics to [packages].
SyntaxColoring May 24, 2024
d3c6ce2
Install pydantic-settings in system-server.
SyntaxColoring May 24, 2024
34cae8c
Add pydantic-settings to robot-server/setup.py.
SyntaxColoring May 24, 2024
7ee2b47
Re-lock everything.
SyntaxColoring May 24, 2024
1b3b099
robot-server: Run bump-pydantic.
SyntaxColoring May 24, 2024
06e87fd
robot-server: Remove now-unneeded type-ignores.
SyntaxColoring May 24, 2024
9cdeb04
robot-server: Add a unit test for robot_server.persistence.pydantic.
SyntaxColoring May 24, 2024
5f60e97
robot-server: Post-merge fixups to robot_server.persistence.pydantic.
SyntaxColoring May 24, 2024
dd461e9
system-server: Run bump-pydantic.
SyntaxColoring May 24, 2024
3b1da95
system-server: Manual fixups.
SyntaxColoring May 24, 2024
ff3db4e
Merge remote-tracking branch 'origin/edge' into chore_update-pydantic-v2
SyntaxColoring May 28, 2024
14f5c10
g-code-testing: Run bump-pydantic [WIP]
SyntaxColoring May 24, 2024
01f0ed9
WIP: Fix some slow stuff with TypeAdapter?
SyntaxColoring May 24, 2024
de2b400
robot-server: Update error messages in tests.
SyntaxColoring May 25, 2024
d674c66
Revert BaseModel -> BaseResponseBody changes.
SyntaxColoring Jun 7, 2024
1d95e40
Merge branch 'edge' into chore_update-pydantic-v2
sfoster1 Sep 3, 2024
18a3b22
chore: format and fix lints
sfoster1 Sep 4, 2024
9417cd0
s-d: fix tests
sfoster1 Sep 4, 2024
315a370
api: fix testst
sfoster1 Sep 4, 2024
fea1fad
schema format
sfoster1 Sep 5, 2024
7fecd09
make this installable per https://github.com/pypa/setuptools/issues/4483
sfoster1 Sep 5, 2024
b0c849f
Merge branch 'edge' into chore_update-pydantic-v2
sfoster1 Sep 5, 2024
8082363
chore: pydantic 2.9.0
sfoster1 Sep 5, 2024
b3f7e04
chore: mypy 1.11.0
sfoster1 Sep 5, 2024
5a781f1
chore: py lint fixes
sfoster1 Sep 5, 2024
bab482b
chore: fix hardware-testing
sfoster1 Sep 5, 2024
aaf8f58
chore: fix api runtime type dependencies
sfoster1 Sep 6, 2024
9159f4a
fixup command schema
sfoster1 Sep 6, 2024
666b3ff
fixup some server tests
sfoster1 Sep 9, 2024
cdbf235
Merge branch 'edge' into chore_update-pydantic-v2
sfoster1 Nov 1, 2024
4809ec3
Merge branch 'edge' into chore_update-pydantic-v2
sfoster1 Dec 3, 2024
25f0c72
get lint all the way working
sfoster1 Dec 3, 2024
6ddf38b
shared-data: lint, test, warnings
sfoster1 Dec 3, 2024
f3dd85a
robot-server lint
sfoster1 Dec 3, 2024
6344995
s-d: enum handling
sfoster1 Dec 3, 2024
fce1971
all but ischema string
sfoster1 Dec 3, 2024
e3a6b90
sort the schema for better comparison later
sfoster1 Dec 3, 2024
74606e6
fix schema generation
sfoster1 Dec 3, 2024
a26b495
fix the rest of the api warnings
sfoster1 Dec 3, 2024
f3c812c
fix some r-s and s-s warnings
sfoster1 Dec 3, 2024
6332c99
more server fixes
sfoster1 Dec 4, 2024
2170735
non-integration tests fixed
sfoster1 Dec 5, 2024
dcd9257
more validation stuff
sfoster1 Dec 5, 2024
6fd9da7
Format.
SyntaxColoring Dec 9, 2024
f9dba7e
int instead of float for ge.
SyntaxColoring Dec 9, 2024
b5b28b6
Fix "global" `exclude_none=True` override.
SyntaxColoring Dec 10, 2024
6bd2223
Delete redundant BaseModel inheritance.
SyntaxColoring Dec 10, 2024
3414714
Revert `exclude_none=True, exclude_unset=True, exclude_defaults=True`…
SyntaxColoring Dec 10, 2024
b00a4ec
Revert test_response.py changes.
SyntaxColoring Dec 10, 2024
44f0f4d
Shift datetime workaround from production code to tests.
SyntaxColoring Dec 10, 2024
e065c31
Merge branch 'edge' into chore_update-pydantic-v2
SyntaxColoring Dec 10, 2024
fd76bcf
Fix robot-server docs build script.
SyntaxColoring Dec 10, 2024
f871244
Delete `no_strict_optional=True` workaround.
SyntaxColoring Dec 10, 2024
ab72323
performance-metrics: Fix systemd-python marker and re-lock.
SyntaxColoring Dec 10, 2024
4a874de
performance-metrics: Ignore missing systemd.daemon import.
SyntaxColoring Dec 10, 2024
854219d
Bump test server startup timeout from 20 to 40.
SyntaxColoring Dec 10, 2024
54eb964
Revert .construct() -> .__init__() in legacy_command_mapper.py.
SyntaxColoring Dec 10, 2024
8e14b56
Merge branch 'edge' into chore_update-pydantic-v2
SyntaxColoring Dec 10, 2024
3a7f070
Lint hardware-testing.
SyntaxColoring Dec 10, 2024
d5a707d
Revert changes to command schema 8.
SyntaxColoring Dec 10, 2024
4cefc25
Fix unused type ignore.
SyntaxColoring Dec 11, 2024
6ee8fa2
Format.
SyntaxColoring Dec 11, 2024
9768f01
Fix verify_definition() type-checking.
SyntaxColoring Dec 11, 2024
3dbe348
Add missing pydantic-settings specs to api and hardware setup.py.
SyntaxColoring Dec 11, 2024
10483bc
Experiment: Re-lock some Python projects.
SyntaxColoring Dec 11, 2024
8d7d85d
Manually complete g-code-testing migration.
SyntaxColoring Dec 12, 2024
8e81542
Merge remote-tracking branch 'origin/edge' into chore_update-pydantic-v2
SyntaxColoring Dec 12, 2024
212e876
Migrate new command annotation code.
SyntaxColoring Dec 12, 2024
a17012f
Revert use of pydantic_core.from_json() in labware def validation.
SyntaxColoring Dec 12, 2024
fe5005e
Revert vector model moves/refactors.
SyntaxColoring Dec 12, 2024
6f5cdba
Replace conint etc. with Annotated. Remove obsolete TYPE_CHECKING con…
SyntaxColoring Dec 12, 2024
f8263cb
Shore up HexColor tests for my paranoia.
SyntaxColoring Dec 12, 2024
ab27980
Fix up command schema after revert of vector refactors.
SyntaxColoring Dec 13, 2024
944b3f5
Fix incorrect construction of LabwareOffsetVectors.
SyntaxColoring Dec 13, 2024
909295d
Fix text decoding when parsing JSON from files.
SyntaxColoring Dec 13, 2024
93affa8
Update analysis snapshots for 0 changing to 0.0.
SyntaxColoring Dec 13, 2024
2b4863c
Revert jsonschema loosening.
SyntaxColoring Dec 14, 2024
2550326
Update snapshot test for protocol type coercion bug.
SyntaxColoring Dec 13, 2024
2c32dd3
Undo formatting change to mypy.ini.
SyntaxColoring Dec 14, 2024
3a29b86
Merge branch 'edge' into chore_update-pydantic-v2
SyntaxColoring Dec 16, 2024
8eac2cd
Diff minimization: Revert labware_definition->models rename.
SyntaxColoring Dec 16, 2024
33a3fc7
Revert apparently unnecessary exclude_unset etc.
SyntaxColoring Dec 16, 2024
0d7f92b
Diff minimization: Revert some trivial renames.
SyntaxColoring Dec 16, 2024
b451291
Diff minimization: Revert some small non-semantic changes (formatting…
SyntaxColoring Dec 16, 2024
7767537
limit rpds to something old enough for oe
sfoster1 Dec 16, 2024
c508888
why was it like this? it cant be like this
sfoster1 Dec 16, 2024
3686593
Re-delete ResponseList.
SyntaxColoring Dec 16, 2024
c714786
Diff minimization: .json() and .dict() overrides.
SyntaxColoring Dec 16, 2024
5bc242b
Delete now-obsolete (?) TypeAdapter overload workaround.
SyntaxColoring Dec 16, 2024
53d902d
perf: Parse RTPs through a TypeAdapter.
SyntaxColoring Dec 16, 2024
d7b1740
Delete todo comment in _up_to_3_worker.py.
SyntaxColoring Dec 16, 2024
d97002b
Merge branch 'edge' into chore_update-pydantic-v2
SyntaxColoring Dec 17, 2024
eedc0e0
Update JSONResponse docstring.
SyntaxColoring Dec 17, 2024
023276e
Handle the new startingTipWell param like other None-valued params.
SyntaxColoring Dec 17, 2024
b412650
surprise, this went through Any and wasn't caught
sfoster1 Dec 17, 2024
976b759
chore: need pydantic-settings in buildroot
sfoster1 Dec 18, 2024
363abb7
chore: update buildroot server start timeout
sfoster1 Dec 18, 2024
6549c34
need this for ot2 also
sfoster1 Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,539 changes: 869 additions & 670 deletions abr-testing/Pipfile.lock

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10789,9 +10789,9 @@
"pipetteId": "UUID",
"wellLocation": {
"offset": {
"x": 0,
"y": 0,
"z": 0
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"origin": "default"
},
Expand Down Expand Up @@ -10921,9 +10921,9 @@
"pipetteId": "UUID",
"wellLocation": {
"offset": {
"x": 0,
"y": 0,
"z": 0
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"origin": "default"
},
Expand Down Expand Up @@ -11121,9 +11121,9 @@
"pipetteId": "UUID",
"wellLocation": {
"offset": {
"x": 0,
"y": 0,
"z": 0
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"origin": "default"
},
Expand Down Expand Up @@ -11253,9 +11253,9 @@
"pipetteId": "UUID",
"wellLocation": {
"offset": {
"x": 0,
"y": 0,
"z": 0
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"origin": "default"
},
Expand Down
Loading
Loading