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

chore: bump pydantic to 2.3.0 #159

Merged
merged 12 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## \[Unreleased\]

### Changed

- Update to pydantic 2.3.0 ([#159](https://github.com/Substra/substrafl/pull/159))

## [0.40.0](https://github.com/Substra/substrafl/releases/tag/0.40.0) - 2023-09-07

### Added
Expand All @@ -22,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
)
```

- Dependency objects are now computed at initialization in a cache directory, accessible through the `cache_directory` attribute. The cache directory is deleted at the Dependency object deletion. ([https://github.com/Substra/substrafl/pull/155])(https://github.com/Substra/substrafl/pull/155))
- Dependency objects are now computed at initialization in a cache directory, accessible through the `cache_directory` attribute. The cache directory is deleted at the Dependency object deletion. ([https://github.com/Substra/substrafl/pull/155])(<https://github.com/Substra/substrafl/pull/155>))
- Check created wheels name. ([#160](https://github.com/Substra/substrafl/pull/160))

### Changed
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
# The following elements are the link that auto doc were not able to do
nitpick_ignore = [
("py:class", "pydantic.main.BaseModel"),
("py:class", "BaseModel"),
("py:class", "torch.nn.modules.module.Module"),
("py:class", "torch.nn.modules.loss._Loss"),
("py:class", "torch.optim.optimizer.Optimizer"),
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
install_requires=[
"numpy>=1.20.3, <1.24",
"cloudpickle>=1.6.0",
"substra~=0.47.0",
"substra~=0.48.0",
"substratools~=0.20.0",
"pydantic>=1.9.0, <2.0",
"pydantic>=2.3.0,<3.0",
"pip>=21.2",
"wheel",
"six",
Expand All @@ -59,7 +59,7 @@
"pre-commit>=2.13.0",
"types-PyYAML>=6.0.0",
"torch>=1.9.1,!=1.12.0", # bug in 1.12.0 (https://github.com/pytorch/pytorch/pull/80345)
"nbmake>=1.1",
"nbmake>=1.4.3",
"docker",
],
},
Expand Down
1 change: 0 additions & 1 deletion substrafl/dependency/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class Dependency(BaseModel):

class Config:
arbitrary_types_allowed = True
underscore_attrs_are_private = True

def __init__(self, *args, **kwargs):
"""Dependencies are computed at object initialization.
Expand Down
2 changes: 1 addition & 1 deletion substrafl/nodes/aggregation_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def update_states(
else None
)

task_metadata = {"round_idx": round_idx} if round_idx is not None else {}
task_metadata = {"round_idx": str(round_idx)} if round_idx is not None else {}
aggregate_task = substra.schemas.ComputePlanTaskSpec(
function_key=str(uuid.uuid4()), # bogus function key
task_id=op_id,
Expand Down
2 changes: 1 addition & 1 deletion substrafl/nodes/test_data_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def update_states(
parent_task_output_identifier=OutputIdentifiers.predictions,
)
]
task_metadata = {"round_idx": round_idx} if round_idx is not None else {}
task_metadata = {"round_idx": str(round_idx)} if round_idx is not None else {}

predicttask = substra.schemas.ComputePlanTaskSpec(
function_key=str(uuid.uuid4()), # bogus function key
Expand Down
4 changes: 2 additions & 2 deletions substrafl/nodes/train_data_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def init_states(
),
},
metadata={
"round_idx": round_idx,
"round_idx": str(round_idx),
},
tag=TaskType.INITIALIZATION,
worker=self.organization_id,
Expand Down Expand Up @@ -160,7 +160,7 @@ def update_states(
else:
shared_inputs = []

task_metadata = {"round_idx": round_idx} if round_idx is not None else {}
task_metadata = {"round_idx": str(round_idx)} if round_idx is not None else {}
train_task = substra.schemas.ComputePlanTaskSpec(
function_key=str(uuid.uuid4()), # bogus function key
task_id=op_id,
Expand Down
Loading