Skip to content

Commit 8732b24

Browse files
committed
Bootstrap 2.0 migration docs for pydantic 2.0 change
1 parent 4596499 commit 8732b24

File tree

5 files changed

+67
-20
lines changed

5 files changed

+67
-20
lines changed

CHANGELOG.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Changelog
22

3-
## v1.10.0 - 2023-11-16
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6+
7+
## [2.0.0]
8+
9+
### Changed
10+
11+
- **BREAKING CHANGE** #236/240 - Upgrade to Pydantic v2.
12+
13+
## [1.10.0] - 2023-11-16
414

515
### Fixed
616

@@ -11,7 +21,7 @@
1121

1222
- #247 - Deprecates Python 3.7
1323

14-
## v1.9.0 - 2023-10-16
24+
## [1.9.0] - 2023-10-16
1525

1626
### Added
1727

@@ -21,7 +31,7 @@
2131

2232
- #219 - Type hinting overhaul
2333

24-
## v1.8.0 - 2023-04-18
34+
## [1.8.0] - 2023-04-18
2535

2636
### Added
2737

@@ -34,7 +44,7 @@
3444
- #77/#188 - `sync_from()` and `sync_to()` now return the `Diff` that was applied.
3545
- #211 - Loosened `packaging` and `structlog` library dependency constraints for broader compatibility.
3646

37-
## v1.7.0 - 2022-11-03
47+
## [1.7.0] - 2022-11-03
3848

3949
### Changed
4050

@@ -52,15 +62,15 @@
5262

5363
### Fixed
5464

55-
- #149 Limit redundant CI concurrency
65+
- #149 - Limit redundant CI concurrency
5666

57-
## v1.6.0 - 2022-07-09
67+
## [1.6.0] - 2022-07-09
5868

5969
### Changed
6070

6171
- #120 - Dropped support for Python 3.6, new minimum is Python 3.7
6272

63-
## v1.5.1 - 2022-06-30
73+
## [1.5.1] - 2022-06-30
6474

6575
### Added
6676

@@ -75,13 +85,13 @@
7585
- #115 - Fixed ReadTheDocs rendering pipeline
7686
- #118 - Fixed a regression in `DiffSync.get(modelname, identifiers)` introduced in 1.5.0
7787

78-
## v1.5.0 - 2022-06-07
88+
## [1.5.0] - 2022-06-07
7989

8090
### Added
8191

8292
- #106 - Add a new, optional, backend store based in Redis
8393

84-
## v1.4.3 - 2022-03-03
94+
## [1.4.3] - 2022-03-03
8595

8696
### Fixed
8797

@@ -91,25 +101,25 @@
91101

92102
### Changed
93103

94-
- #103 Update development dependencies
104+
- #103 - Update development dependencies
95105

96-
## v1.4.2 - 2022-02-28
106+
## [1.4.2] - 2022-02-28
97107

98108
**WARNING** - #90 inadvertently introduced a breaking API change in DiffSync 1.4.0 through 1.4.2 (#101); this change was reverted in #102 for DiffSync 1.4.3 and later. We recommend not using this release, and moving to 1.4.3 instead.
99109

100110
### Fixed
101111

102112
- #100 - Added explicit dependency on `packaging`.
103113

104-
## v1.4.1 - 2022-01-26
114+
## [1.4.1] - 2022-01-26
105115

106116
**WARNING** - #90 inadvertently introduced a breaking API change in DiffSync 1.4.0 through 1.4.2 (#101); this change was reverted in #102 for DiffSync 1.4.3 and later. We recommend not using this release, and moving to 1.4.3 instead.
107117

108118
### Fixed
109119

110120
- #95 - Removed optional dependencies on `sphinx`, `m2r2`, `sphinx-rtd-theme`, `toml`.
111121

112-
## v1.4.0 - 2022-01-24
122+
## [1.4.0] - 2022-01-24
113123

114124
**WARNING** - #90 inadvertently introduced a breaking API change in DiffSync 1.4.0 through 1.4.2 (#101); this change was reverted in #102 for DiffSync 1.4.3 and later. We recommend not using this release, and moving to 1.4.3 instead.
115125

@@ -138,19 +148,19 @@
138148
- #51 - Update minimum Pydantic version due to security advisory GHSA-5jqp-qgf6-3pvh
139149
- #63 - Fix type in Readme
140150

141-
## v1.3.0 - 2021-04-07
151+
## [1.3.0] - 2021-04-07
142152

143153
### Added
144154

145155
- #48 - added optional `callback` argument to `diff_from`/`diff_to`/`sync_from`/`sync_to` for use with progress reporting.
146156

147-
## v1.2.0 - 2020-12-08
157+
## [1.2.0] - 2020-12-08
148158

149159
### Added
150160

151161
- #45 - minimum Python version lowered from 3.7 to 3.6, also now tested against Python 3.9.
152162

153-
## v1.1.0 - 2020-12-01
163+
## [1.1.0] - 2020-12-01
154164

155165
### Added
156166

@@ -168,6 +178,6 @@
168178

169179
- #44 - On CRUD failure, do not generate an extraneous "success" log message in addition to the "failed" message
170180

171-
## v1.0.0 - 2020-10-23
181+
## [1.0.0] - 2020-10-23
172182

173183
Initial release

docs/source/getting_started/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
###############
2-
Getting Started
3-
###############
1+
#########
2+
Upgrading
3+
#########
44

55
.. mdinclude:: 01-getting-started.md

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Welcome to DiffSync's documentation!
99
getting_started/index
1010
core_engine/index
1111
examples/index
12+
upgrading/index
1213
api/diffsync
1314
license/index
1415

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Upgrading to 2.0
2+
3+
With diffsync 2.0, there a couple of breaking changes. What they are and how to deal with them is described in this document.
4+
5+
## Upgrade to Pydantic's major version 2
6+
7+
A [migration guide](https://docs.pydantic.dev/latest/migration/) is available in the Pydantic documentation. Here are the key things that may apply to your usage of diffsync:
8+
9+
- Any fields that are of type `Optional` now need to provide an explicit `None` default (you can use [bump-pydantic](https://github.com/pydantic/bump-pydantic) to deal with this automatically for the most part)
10+
11+
```python
12+
from typing import Optional
13+
14+
from diffsync import DiffSyncModel
15+
16+
# Before
17+
class Person(DiffSyncModel):
18+
_identifiers = ("name",)
19+
_attributes = ("age",)
20+
21+
name: str
22+
age: Optional[int]
23+
24+
# After
25+
class BetterPerson(DiffSyncModel)
26+
_identifiers = ("name",)
27+
_attributes = ("age",)
28+
29+
name: str
30+
age: Optional[int] = None
31+
```

docs/source/upgrading/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#########
2+
Upgrading
3+
#########
4+
5+
.. mdinclude:: 01-upgrading-to-2.0.md

0 commit comments

Comments
 (0)