oslo.versionedobjects 3.10.2__tar.gz → 3.11.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/.pre-commit-config.yaml +2 -2
  2. oslo_versionedobjects-3.11.0/.zuul.yaml +69 -0
  3. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/ChangeLog +25 -0
  4. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/PKG-INFO +3 -5
  5. oslo_versionedobjects-3.11.0/doc/source/user/examples.rst +23 -0
  6. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo.versionedobjects.egg-info/PKG-INFO +3 -5
  7. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo.versionedobjects.egg-info/SOURCES.txt +9 -0
  8. oslo_versionedobjects-3.11.0/oslo.versionedobjects.egg-info/pbr.json +1 -0
  9. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo.versionedobjects.egg-info/requires.txt +0 -2
  10. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/base.py +111 -66
  11. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/fields.py +39 -27
  12. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/mypy.py +64 -57
  13. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/test.py +0 -27
  14. oslo_versionedobjects-3.11.0/oslo_versionedobjects/tests/test_data/basic_fields.py +36 -0
  15. oslo_versionedobjects-3.11.0/oslo_versionedobjects/tests/test_data/compound_fields.py +52 -0
  16. oslo_versionedobjects-3.11.0/oslo_versionedobjects/tests/test_data/empty_fields.py +19 -0
  17. oslo_versionedobjects-3.11.0/oslo_versionedobjects/tests/test_data/enum_fields.py +40 -0
  18. oslo_versionedobjects-3.11.0/oslo_versionedobjects/tests/test_data/object_fields.py +47 -0
  19. oslo_versionedobjects-3.11.0/oslo_versionedobjects/tests/test_data/subclassing.py +37 -0
  20. oslo_versionedobjects-3.11.0/oslo_versionedobjects/tests/test_data/timestamp_mixin.py +28 -0
  21. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/tests/test_fields.py +47 -4
  22. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/tests/test_fixture.py +1 -1
  23. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/tests/test_mypy.py +259 -204
  24. oslo_versionedobjects-3.11.0/oslo_versionedobjects/tests/test_mypy_integration.py +164 -0
  25. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/tests/test_objects.py +11 -9
  26. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/pyproject.toml +4 -3
  27. oslo_versionedobjects-3.11.0/releasenotes/notes/remove-py310-2e38a61a45ea7584.yaml +5 -0
  28. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/requirements.txt +0 -2
  29. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/tox.ini +4 -6
  30. oslo_versionedobjects-3.10.2/.zuul.yaml +0 -27
  31. oslo_versionedobjects-3.10.2/doc/source/user/examples.rst +0 -23
  32. oslo_versionedobjects-3.10.2/oslo.versionedobjects.egg-info/pbr.json +0 -1
  33. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/.coveragerc +0 -0
  34. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/.mailmap +0 -0
  35. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/.stestr.conf +0 -0
  36. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/AUTHORS +0 -0
  37. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/CONTRIBUTING.rst +0 -0
  38. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/HACKING.rst +0 -0
  39. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/LICENSE +0 -0
  40. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/README.rst +0 -0
  41. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/bindep.txt +0 -0
  42. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/requirements.txt +0 -0
  43. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/conf.py +0 -0
  44. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/configuration/index.rst +0 -0
  45. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/contributor/index.rst +0 -0
  46. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/index.rst +0 -0
  47. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/install/index.rst +0 -0
  48. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/reference/base.rst +0 -0
  49. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/reference/exception.rst +0 -0
  50. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/reference/fields.rst +0 -0
  51. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/reference/fixture.rst +0 -0
  52. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/reference/index.rst +0 -0
  53. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/user/history.rst +0 -0
  54. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/user/index.rst +0 -0
  55. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/user/typing.rst +0 -0
  56. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/doc/source/user/usage.rst +0 -0
  57. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo.versionedobjects.egg-info/dependency_links.txt +0 -0
  58. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo.versionedobjects.egg-info/entry_points.txt +0 -0
  59. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo.versionedobjects.egg-info/not-zip-safe +0 -0
  60. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo.versionedobjects.egg-info/top_level.txt +0 -0
  61. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/__init__.py +0 -0
  62. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/_i18n.py +0 -0
  63. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/_options.py +0 -0
  64. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/_utils.py +0 -0
  65. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/examples/__init__.py +0 -0
  66. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/examples/iot_bulb.py +0 -0
  67. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/exception.py +0 -0
  68. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/fixture.py +0 -0
  69. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/locale/en_GB/LC_MESSAGES/oslo_versionedobjects.po +0 -0
  70. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/py.typed +0 -0
  71. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/tests/__init__.py +0 -0
  72. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/tests/obj_fixtures.py +0 -0
  73. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/oslo_versionedobjects/tests/test_exception.py +0 -0
  74. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/notes/add-reno-996dd44974d53238.yaml +0 -0
  75. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/notes/deprecate-remotable_classmethod-3c7d0f658af39fb6.yaml +0 -0
  76. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/notes/drop-python27-support-b3e377b0dcfa4f5c.yaml +0 -0
  77. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/notes/remove-field-staticmethods-62f5a62b2544b603.yaml +0 -0
  78. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/notes/remove-py38-f4e8c7ce18a5914b.yaml +0 -0
  79. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/notes/remove-py39-a35bc15c07073b80.yaml +0 -0
  80. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/notes/remove-test-helpers-032475d5bc2ec8ca.yaml +0 -0
  81. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/notes/update_md5_for_fips-e5a8f8f438ac81fb.yaml +0 -0
  82. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/2023.1.rst +0 -0
  83. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/2023.2.rst +0 -0
  84. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/2024.1.rst +0 -0
  85. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/2024.2.rst +0 -0
  86. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/2025.1.rst +0 -0
  87. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/2025.2.rst +0 -0
  88. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/2026.1.rst +0 -0
  89. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/_static/.placeholder +0 -0
  90. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/_templates/.placeholder +0 -0
  91. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/conf.py +0 -0
  92. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/index.rst +0 -0
  93. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po +0 -0
  94. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/ocata.rst +0 -0
  95. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/pike.rst +0 -0
  96. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/queens.rst +0 -0
  97. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/rocky.rst +0 -0
  98. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/stein.rst +0 -0
  99. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/train.rst +0 -0
  100. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/unreleased.rst +0 -0
  101. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/ussuri.rst +0 -0
  102. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/victoria.rst +0 -0
  103. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/wallaby.rst +0 -0
  104. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/xena.rst +0 -0
  105. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/yoga.rst +0 -0
  106. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/releasenotes/source/zed.rst +0 -0
  107. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/setup.cfg +0 -0
  108. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/setup.py +0 -0
  109. {oslo_versionedobjects-3.10.2 → oslo_versionedobjects-3.11.0}/test-requirements.txt +0 -0
@@ -13,13 +13,13 @@ repos:
13
13
  - id: check-yaml
14
14
  files: .*\.(yaml|yml)$
15
15
  - repo: https://github.com/astral-sh/ruff-pre-commit
16
- rev: v0.15.4
16
+ rev: v0.15.19
17
17
  hooks:
18
18
  - id: ruff-check
19
19
  args: ['--fix', '--unsafe-fixes']
20
20
  - id: ruff-format
21
21
  - repo: https://opendev.org/openstack/hacking
22
- rev: 8.0.0
22
+ rev: 8.1.0
23
23
  hooks:
24
24
  - id: hacking
25
25
  additional_dependencies: []
@@ -0,0 +1,69 @@
1
+ ---
2
+
3
+ - project:
4
+ check:
5
+ jobs:
6
+ - oslo.versionedobjects-src-grenade-multinode
7
+ - oslo.versionedobjects-nova-tox-py313
8
+ - oslo.versionedobjects-ironic-tox-py313
9
+ gate:
10
+ jobs:
11
+ - oslo.versionedobjects-nova-tox-py313
12
+ - oslo.versionedobjects-ironic-tox-py313
13
+ templates:
14
+ - check-requirements
15
+ - lib-forward-testing-python3
16
+ - openstack-python3-jobs
17
+ - openstack-python3-next-jobs
18
+ - periodic-stable-jobs
19
+ - publish-openstack-docs-pti
20
+ - release-notes-jobs-python3
21
+
22
+ - job:
23
+ name: oslo.versionedobjects-nova-tox-py313
24
+ parent: openstack-tox-py313
25
+ description: |
26
+ Run cross-project unit tests on nova.
27
+ vars:
28
+ zuul_work_dir: src/opendev.org/openstack/nova
29
+ required-projects:
30
+ - openstack/nova
31
+ - openstack/oslo.versionedobjects
32
+ irrelevant-files: &irrelevant-files
33
+ - ^\.gitignore$
34
+ - ^\.gitreview$
35
+ - ^.*\.rst$
36
+ - ^doc/.*$
37
+ - LICENSE
38
+ - ^releasenotes/.*$
39
+ - ^\.pre-commit-config\.yaml$
40
+ - ^oslo_versionedobjects/tests/.*$
41
+ - ^test-requirements\.txt$
42
+
43
+ - job:
44
+ name: oslo.versionedobjects-ironic-tox-py313
45
+ parent: openstack-tox-py313
46
+ description: |
47
+ Run cross-project unit tests on ironic.
48
+ vars:
49
+ zuul_work_dir: src/opendev.org/openstack/ironic
50
+ required-projects:
51
+ - openstack/ironic
52
+ - openstack/oslo.versionedobjects
53
+ irrelevant-files: *irrelevant-files
54
+
55
+ - job:
56
+ name: oslo.versionedobjects-src-grenade-multinode
57
+ parent: grenade-multinode
58
+ voting: false
59
+ irrelevant-files:
60
+ - ^.*\.rst$
61
+ - ^doc/.*$
62
+ - ^releasenotes/.*$
63
+ - ^.git.*$
64
+ - ^.*/locale/.*po$
65
+ - ^(test-|)requirements.txt$
66
+ - ^setup.cfg$
67
+ - ^\.pre-commit-config\.yaml$
68
+ required-projects:
69
+ - opendev.org/openstack/oslo.versionedobjects
@@ -1,6 +1,26 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
+ 3.11.0
5
+ ------
6
+
7
+ * trivial: Fix docstrings
8
+ * tests: Use isolated cache dirs for mypy integration tests
9
+ * zuul: Use openstack-python3-next-jobs template
10
+ * pre-commit: Bump versions
11
+ * Do not install code to build release notes
12
+ * tests: Add mypy plugin integration tests
13
+ * Drop support for Python 3.10
14
+ * typing: Correct return type of obj\_make\_list
15
+ * mypy: Fix cross-module field inheritance for mixin classes
16
+ * mypy: Resolve ObjectField types in a second pass
17
+ * mypy: Drop field caching
18
+ * mypy: Derive field types from generic parameter
19
+ * tests: De-dupe AST generation
20
+ * trivial: Remove unnecessary quotes
21
+ * Replace tabs with spaces
22
+ * tox: Use new constraints option
23
+
4
24
  3.10.2
5
25
  ------
6
26
 
@@ -8,12 +28,17 @@ CHANGES
8
28
  3.10.1
9
29
  ------
10
30
 
31
+ * Add cross-testing for nova, ironic
11
32
  * Remove abstractmethod from deprecated object\_backport method
12
33
  * Accept context passed by kwarg
13
34
  * typing: Resolve ObjectField and ListOfObjectsField to concrete types
35
+ * test: Remove use of oslo\_concurrency.lockutils
36
+ * fields: Add primitive field types from nova
14
37
  * Rename args -> kwargs
15
38
  * Remove unecessary try-except login in mypy plugin
16
39
  * Remove some duplication in the mypy plugin
40
+ * base: Add docs for obj\_extra\_fields attribute
41
+ * base: Make variables comments readable by Sphinx
17
42
 
18
43
  3.10.0
19
44
  ------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oslo.versionedobjects
3
- Version: 3.10.2
3
+ Version: 3.11.0
4
4
  Summary: Oslo Versioned Objects library
5
5
  Author-email: OpenStack <openstack-discuss@lists.openstack.org>
6
6
  License: Apache-2.0
@@ -13,19 +13,17 @@ Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Operating System :: POSIX :: Linux
14
14
  Classifier: Programming Language :: Python
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
20
  Classifier: Typing :: Typed
21
- Requires-Python: >=3.10
21
+ Requires-Python: >=3.11
22
22
  Description-Content-Type: text/x-rst
23
23
  License-File: LICENSE
24
- Requires-Dist: oslo.concurrency>=3.26.0
25
24
  Requires-Dist: oslo.config>=5.2.0
26
25
  Requires-Dist: oslo.context>=2.19.2
27
26
  Requires-Dist: oslo.messaging>=5.29.0
28
- Requires-Dist: oslo.serialization>=2.18.0
29
27
  Requires-Dist: oslo.utils>=7.4.0
30
28
  Requires-Dist: oslo.log>=3.36.0
31
29
  Requires-Dist: oslo.i18n>=3.15.3
@@ -0,0 +1,23 @@
1
+ ==========
2
+ Examples
3
+ ==========
4
+
5
+ IOT lightbulb
6
+ =============
7
+
8
+ .. note::
9
+
10
+ Full source located at :example:`iot_bulb`.
11
+
12
+ .. literalinclude:: ../../../oslo_versionedobjects/examples/iot_bulb.py
13
+ :language: python
14
+ :linenos:
15
+ :lines: 14-
16
+
17
+ Expected (or similar) output::
18
+
19
+ The __str__() output of this new object: IOTLightbulb(manufactured_on=2017-03-15T23:25:01Z,serial='abc-123')
20
+ The 'serial' field of the object: abc-123
21
+ Primitive representation of this object: {'versioned_object.version': '1.0', 'versioned_object.changes': ['serial', 'manufactured_on'], 'versioned_object.name': 'IOTLightbulb', 'versioned_object.data': {'serial': u'abc-123', 'manufactured_on': '2017-03-15T23:25:01Z'}, 'versioned_object.namespace': 'versionedobjects.examples'}
22
+ The __str__() output of this new (reconstructed) object: IOTLightbulb(manufactured_on=2017-03-15T23:25:01Z,serial='abc-123')
23
+ After serial number change, the set of fields that have been mutated is: set(['serial'])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oslo.versionedobjects
3
- Version: 3.10.2
3
+ Version: 3.11.0
4
4
  Summary: Oslo Versioned Objects library
5
5
  Author-email: OpenStack <openstack-discuss@lists.openstack.org>
6
6
  License: Apache-2.0
@@ -13,19 +13,17 @@ Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Operating System :: POSIX :: Linux
14
14
  Classifier: Programming Language :: Python
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
20
  Classifier: Typing :: Typed
21
- Requires-Python: >=3.10
21
+ Requires-Python: >=3.11
22
22
  Description-Content-Type: text/x-rst
23
23
  License-File: LICENSE
24
- Requires-Dist: oslo.concurrency>=3.26.0
25
24
  Requires-Dist: oslo.config>=5.2.0
26
25
  Requires-Dist: oslo.context>=2.19.2
27
26
  Requires-Dist: oslo.messaging>=5.29.0
28
- Requires-Dist: oslo.serialization>=2.18.0
29
27
  Requires-Dist: oslo.utils>=7.4.0
30
28
  Requires-Dist: oslo.log>=3.36.0
31
29
  Requires-Dist: oslo.i18n>=3.15.3
@@ -60,11 +60,20 @@ oslo_versionedobjects/tests/test_exception.py
60
60
  oslo_versionedobjects/tests/test_fields.py
61
61
  oslo_versionedobjects/tests/test_fixture.py
62
62
  oslo_versionedobjects/tests/test_mypy.py
63
+ oslo_versionedobjects/tests/test_mypy_integration.py
63
64
  oslo_versionedobjects/tests/test_objects.py
65
+ oslo_versionedobjects/tests/test_data/basic_fields.py
66
+ oslo_versionedobjects/tests/test_data/compound_fields.py
67
+ oslo_versionedobjects/tests/test_data/empty_fields.py
68
+ oslo_versionedobjects/tests/test_data/enum_fields.py
69
+ oslo_versionedobjects/tests/test_data/object_fields.py
70
+ oslo_versionedobjects/tests/test_data/subclassing.py
71
+ oslo_versionedobjects/tests/test_data/timestamp_mixin.py
64
72
  releasenotes/notes/add-reno-996dd44974d53238.yaml
65
73
  releasenotes/notes/deprecate-remotable_classmethod-3c7d0f658af39fb6.yaml
66
74
  releasenotes/notes/drop-python27-support-b3e377b0dcfa4f5c.yaml
67
75
  releasenotes/notes/remove-field-staticmethods-62f5a62b2544b603.yaml
76
+ releasenotes/notes/remove-py310-2e38a61a45ea7584.yaml
68
77
  releasenotes/notes/remove-py38-f4e8c7ce18a5914b.yaml
69
78
  releasenotes/notes/remove-py39-a35bc15c07073b80.yaml
70
79
  releasenotes/notes/remove-test-helpers-032475d5bc2ec8ca.yaml
@@ -0,0 +1 @@
1
+ {"git_version": "912d08a", "is_release": true}
@@ -1,8 +1,6 @@
1
- oslo.concurrency>=3.26.0
2
1
  oslo.config>=5.2.0
3
2
  oslo.context>=2.19.2
4
3
  oslo.messaging>=5.29.0
5
- oslo.serialization>=2.18.0
6
4
  oslo.utils>=7.4.0
7
5
  oslo.log>=3.36.0
8
6
  oslo.i18n>=3.15.3
@@ -34,8 +34,8 @@ from typing import (
34
34
  Concatenate,
35
35
  overload,
36
36
  ParamSpec,
37
+ Self,
37
38
  TypeVar,
38
- TYPE_CHECKING,
39
39
  )
40
40
  import warnings
41
41
 
@@ -47,12 +47,11 @@ from oslo_versionedobjects._i18n import _
47
47
  from oslo_versionedobjects import exception
48
48
  from oslo_versionedobjects import fields as obj_fields
49
49
 
50
- if TYPE_CHECKING:
51
- from typing_extensions import Self
52
-
53
50
  LOG = logging.getLogger('object')
54
51
 
55
52
  _VO = TypeVar('_VO', bound='VersionedObject')
53
+ # we'd like this to be ObjectListBase[_VO] but Python doesn't allow this :(
54
+ _VOL = TypeVar('_VOL', bound='ObjectListBase[Any]')
56
55
 
57
56
 
58
57
  class _NotSpecifiedSentinel:
@@ -401,62 +400,83 @@ class VersionedObject:
401
400
 
402
401
  indirection_api: VersionedObjectIndirectionAPI | None = None
403
402
 
404
- # Object versioning rules
405
- #
406
- # Each service has its set of objects, each with a version attached. When
407
- # a client attempts to call an object method, the server checks to see if
408
- # the version of that object matches (in a compatible way) its object
409
- # implementation. If so, cool, and if not, fail.
410
- #
411
- # This version is allowed to have three parts, X.Y.Z, where the .Z element
412
- # is reserved for stable branch backports. The .Z is ignored for the
413
- # purposes of triggering a backport, which means anything changed under
414
- # a .Z must be additive and non-destructive such that a node that knows
415
- # about X.Y can consider X.Y.Z equivalent.
403
+ #: Object version field
404
+ #:
405
+ #: Each service has its set of objects, each with a version attached. When
406
+ #: a client attempts to call an object method, the server checks to see if
407
+ #: the version of that object matches (in a compatible way) its object
408
+ #: implementation. If so, cool, and if not, fail.
409
+ #:
410
+ #: This version is allowed to have three parts, ``X.Y.Z``, where the ``.Z``
411
+ #: element is reserved for stable branch backports. The ``.Z`` is ignored
412
+ #: for the purposes of triggering a backport, which means anything changed
413
+ #: under a ``.Z`` must be additive and non-destructive such that a node
414
+ #: that knows about ``X.Y`` can consider ``X.Y.Z`` equivalent.
416
415
  VERSION: str = '1.0'
417
416
 
418
- # Object namespace for serialization
419
- # NB: Generally this should not be changed, but is needed for backwards
420
- # compatibility
417
+ #: Object namespace for serialization
418
+ #:
419
+ #: This should generally not be changed, but is needed for backwards
420
+ #: compatibility
421
421
  OBJ_SERIAL_NAMESPACE: str = 'versioned_object'
422
422
 
423
- # Object project namespace for serialization
424
- # This is used to disambiguate owners of objects sharing a common RPC
425
- # medium
423
+ #: Object project namespace for serialization
424
+ #:
425
+ #: This is used to disambiguate owners of objects sharing a common RPC
426
+ #: medium.
426
427
  OBJ_PROJECT_NAMESPACE: str = 'versionedobjects'
427
428
 
428
- # The fields present in this object as key:field pairs. For example:
429
- #
430
- # fields = { 'foo': obj_fields.IntegerField(),
431
- # 'bar': obj_fields.StringField(),
432
- # }
429
+ #: The fields present in this object as ``key:field`` pairs.
430
+ #:
431
+ #: For example::
432
+ #:
433
+ #: fields = {
434
+ #: 'foo': obj_fields.IntegerField(),
435
+ #: 'bar': obj_fields.StringField(),
436
+ #: }
437
+ #:
433
438
  fields: MutableMapping[str, obj_fields.Field[Any]] = {}
439
+
440
+ #: List of additional object attributes to expose alongside :attr:`fields`.
441
+ #:
442
+ #: Names listed here are typically implemented as Python properties and
443
+ #: are included in :attr:`obj_fields` and exposed through iteration, but
444
+ #: they are not versioned and not serialized during RPC::
445
+ #:
446
+ #: class MyObject(VersionedObject):
447
+ #: fields = {'foo': obj_fields.IntegerField()}
448
+ #: obj_extra_fields = ['bar']
449
+ #:
450
+ #: @property
451
+ #: def bar(self):
452
+ #: return self.foo * 2
434
453
  obj_extra_fields: Sequence[str] = []
435
454
 
436
- # Table of sub-object versioning information
437
- #
438
- # This contains a list of version mappings, by the field name of
439
- # the subobject. The mappings must be in order of oldest to
440
- # newest, and are tuples of (my_version, subobject_version). A
441
- # request to backport this object to $my_version will cause the
442
- # subobject to be backported to $subobject_version.
443
- #
444
- # obj_relationships = {
445
- # 'subobject1': [('1.2', '1.1'), ('1.4', '1.2')],
446
- # 'subobject2': [('1.2', '1.0')],
447
- # }
448
- #
449
- # In the above example:
450
- #
451
- # - If we are asked to backport our object to version 1.3,
452
- # subobject1 will be backported to version 1.1, since it was
453
- # bumped to version 1.2 when our version was 1.4.
454
- # - If we are asked to backport our object to version 1.5,
455
- # no changes will be made to subobject1 or subobject2, since
456
- # they have not changed since version 1.4.
457
- # - If we are asked to backlevel our object to version 1.1, we
458
- # will remove both subobject1 and subobject2 from the primitive,
459
- # since they were not added until version 1.2.
455
+ #: Table of sub-object versioning information
456
+ #:
457
+ #: This contains a list of version mappings, by the field name of
458
+ #: the subobject. The mappings must be in order of oldest to
459
+ #: newest, and are tuples of ``(my_version, subobject_version)``. A
460
+ #: request to backport this object to ``my_version`` will cause the
461
+ #: subobject to be backported to ``subobject_version``::
462
+ #:
463
+ #: obj_relationships = {
464
+ #: 'subobject1': [('1.2', '1.1'), ('1.4', '1.2')],
465
+ #: 'subobject2': [('1.2', '1.0')],
466
+ #: }
467
+ #:
468
+ #: In the above example:
469
+ #:
470
+ #: * If we are asked to backport our object to version 1.3,
471
+ #: ``subobject1`` will be backported to version 1.1, since it was
472
+ #: bumped to version 1.2 when our version was 1.4.
473
+ #: * If we are asked to backport our object to version 1.5,
474
+ #: no changes will be made to ``subobject1`` or ``subobject2``, since
475
+ #: they have not changed since version 1.4.
476
+ #: * If we are asked to backlevel our object to version 1.1, we
477
+ #: will remove both ``subobject1`` and ``subobject2`` from the primitive,
478
+ #: since they were not added until version 1.2.
479
+ #:
460
480
  obj_relationships: dict[str, list[tuple[str, str]]] = {}
461
481
 
462
482
  _changed_fields: set[str]
@@ -507,7 +527,7 @@ class VersionedObject:
507
527
 
508
528
  @classmethod
509
529
  def obj_name(cls) -> str:
510
- """Return the object's name
530
+ """Return the object's name.
511
531
 
512
532
  Return a canonical name for this object which will be used over
513
533
  the wire for remote hydration.
@@ -663,9 +683,9 @@ class VersionedObject:
663
683
  requires that the obj_relationships table in this object is
664
684
  correct and up-to-date.
665
685
 
666
- :param:primitive: The primitive version of this object
667
- :param:target_version: The version string requested for this object
668
- :param:field: The name of the field in this object containing the
686
+ :param primitive: The primitive version of this object
687
+ :param target_version: The version string requested for this object
688
+ :param field: The name of the field in this object containing the
669
689
  sub-object to be backported
670
690
  """
671
691
  relationship_map = self._obj_relationship_for(field, target_version)
@@ -946,7 +966,32 @@ class ComparableVersionedObject:
946
966
  return NotImplemented
947
967
 
948
968
 
949
- class TimestampedObject:
969
+ class VersionedObjectMixin:
970
+ """Marker base class for OVO mixin classes that contribute fields.
971
+
972
+ Mixin classes that define an OVO ``fields`` dict should inherit from this
973
+ class so that the ``oslo_versionedobjects.mypy`` plugin can discover and
974
+ type-check their fields in the same way it handles registered
975
+ ``VersionedObject`` subclasses.
976
+
977
+ Example::
978
+
979
+ class MyFieldsMixin(VersionedObjectMixin):
980
+ fields: MutableMapping[str, fields.Field[Any]] = {
981
+ 'name': fields.StringField(),
982
+ }
983
+
984
+
985
+ @base.VersionedObjectRegistry.register
986
+ class MyObject(MyFieldsMixin, base.VersionedObject):
987
+ VERSION = '1.0'
988
+ fields = {
989
+ 'count': fields.IntegerField(),
990
+ }
991
+ """
992
+
993
+
994
+ class TimestampedObject(VersionedObjectMixin):
950
995
  """Mixin class for db backed objects with timestamp fields.
951
996
 
952
997
  Sqlalchemy models that inherit from the oslo_db TimestampMixin will include
@@ -1222,9 +1267,9 @@ class VersionedObjectSerializer(messaging.NoOpSerializer): # type: ignore[misc]
1222
1267
  ) -> tuple[Any, ...] | list[Any] | dict[str, Any]:
1223
1268
  """Process an iterable, taking an action on each value.
1224
1269
 
1225
- :param:context: Request context
1226
- :param:action_fn: Action to take on each item in values
1227
- :param:values: Iterable container of things to take action on
1270
+ :param context: Request context
1271
+ :param action_fn: Action to take on each item in values
1272
+ :param values: Iterable container of things to take action on
1228
1273
  :returns: A new container of the same type (except set) with
1229
1274
  items from values having had action applied.
1230
1275
  """
@@ -1439,21 +1484,21 @@ class VersionedObjectIndirectionAPI(metaclass=abc.ABCMeta):
1439
1484
 
1440
1485
  def obj_make_list(
1441
1486
  context: Any,
1442
- list_obj: ObjectListBase[_VO],
1487
+ list_obj: _VOL,
1443
1488
  item_cls: type[_VO],
1444
1489
  db_list: list[dict[str, Any]],
1445
1490
  **extra_args: Any,
1446
- ) -> ObjectListBase[_VO]:
1491
+ ) -> _VOL:
1447
1492
  """Construct an object list from a list of primitives.
1448
1493
 
1449
1494
  This calls item_cls._from_db_object() on each item of db_list, and
1450
1495
  adds the resulting object to list_obj.
1451
1496
 
1452
- :param:context: Request context
1453
- :param:list_obj: An ObjectListBase object
1454
- :param:item_cls: The VersionedObject class of the objects within the list
1455
- :param:db_list: The list of primitives to convert to objects
1456
- :param:extra_args: Extra arguments to pass to _from_db_object()
1497
+ :param context: Request context
1498
+ :param list_obj: An ObjectListBase object
1499
+ :param item_cls: The VersionedObject class of the objects within the list
1500
+ :param db_list: The list of primitives to convert to objects
1501
+ :param extra_args: Extra arguments to pass to _from_db_object()
1457
1502
  :returns: list_obj
1458
1503
  """
1459
1504
  list_obj.objects = []
@@ -26,6 +26,7 @@ from typing import (
26
26
  Generic,
27
27
  overload,
28
28
  SupportsIndex,
29
+ Self,
29
30
  TypeVar,
30
31
  TYPE_CHECKING,
31
32
  )
@@ -43,7 +44,6 @@ from oslo_versionedobjects import exception
43
44
 
44
45
  if TYPE_CHECKING:
45
46
  from oslo_versionedobjects import base
46
- from typing_extensions import Self
47
47
 
48
48
  LOG = logging.getLogger('field')
49
49
 
@@ -93,9 +93,9 @@ class AbstractFieldType(Generic[T], metaclass=abc.ABCMeta):
93
93
  This method should convert the value given into the designated type,
94
94
  or throw an exception if this is not possible.
95
95
 
96
- :param:obj: The VersionedObject on which an attribute is being set
97
- :param:attr: The name of the attribute being set
98
- :param:value: The value being set
96
+ :param obj: The VersionedObject on which an attribute is being set
97
+ :param attr: The name of the attribute being set
98
+ :param value: The value being set
99
99
  :returns: A properly-typed value
100
100
  """
101
101
  ...
@@ -109,9 +109,9 @@ class AbstractFieldType(Generic[T], metaclass=abc.ABCMeta):
109
109
  This method should deserialize a value from the form given by
110
110
  to_primitive() to the designated type.
111
111
 
112
- :param:obj: The VersionedObject on which the value is to be set
113
- :param:attr: The name of the attribute which will hold the value
114
- :param:value: The serialized form of the value
112
+ :param obj: The VersionedObject on which the value is to be set
113
+ :param attr: The name of the attribute which will hold the value
114
+ :param value: The serialized form of the value
115
115
  :returns: The natural form of the value
116
116
  """
117
117
  ...
@@ -127,9 +127,9 @@ class AbstractFieldType(Generic[T], metaclass=abc.ABCMeta):
127
127
  This method should serialize a value to the form expected by
128
128
  from_primitive().
129
129
 
130
- :param:obj: The VersionedObject on which the value is set
131
- :param:attr: The name of the attribute holding the value
132
- :param:value: The natural form of the value
130
+ :param obj: The VersionedObject on which the value is set
131
+ :param attr: The name of the attribute holding the value
132
+ :param value: The natural form of the value
133
133
  :returns: The serialized form of the value
134
134
  """
135
135
  ...
@@ -251,9 +251,9 @@ class Field(Generic[T]):
251
251
  nature of the field and calls the coerce() method on a
252
252
  FieldType to actually do the coercion.
253
253
 
254
- :param:obj: The object being acted upon
255
- :param:attr: The name of the attribute/field being set
256
- :param:value: The value being set
254
+ :param obj: The object being acted upon
255
+ :param attr: The name of the attribute/field being set
256
+ :param value: The value being set
257
257
  :returns: The properly-typed value
258
258
  """
259
259
  if value is None:
@@ -282,9 +282,9 @@ class Field(Generic[T]):
282
282
  into regular form. It calls the from_primitive() method on a
283
283
  FieldType to do the actual deserialization.
284
284
 
285
- :param:obj: The object being acted upon
286
- :param:attr: The name of the attribute/field being deserialized
287
- :param:value: The value to be deserialized
285
+ :param obj: The object being acted upon
286
+ :param attr: The name of the attribute/field being deserialized
287
+ :param value: The value to be deserialized
288
288
  :returns: The deserialized value
289
289
  """
290
290
  if value is None:
@@ -301,9 +301,9 @@ class Field(Generic[T]):
301
301
  form. It calls to_primitive() on a FieldType to do the actual
302
302
  serialization.
303
303
 
304
- :param:obj: The object being acted upon
305
- :param:attr: The name of the attribute/field being serialized
306
- :param:value: The value to be serialized
304
+ :param obj: The object being acted upon
305
+ :param attr: The name of the attribute/field being serialized
306
+ :param value: The value to be serialized
307
307
  :returns: The serialized value
308
308
  """
309
309
  if value is None:
@@ -592,7 +592,7 @@ class DateTime(FieldType[datetime.datetime]):
592
592
  # NOTE(danms): Legacy objects from sqlalchemy are stored in UTC,
593
593
  # but are returned without a timezone attached.
594
594
  # As a transitional aid, assume a tz-naive object is in UTC.
595
- ts = ts.replace(tzinfo=datetime.timezone.utc)
595
+ ts = ts.replace(tzinfo=datetime.UTC)
596
596
  elif not self.tzinfo_aware:
597
597
  ts = ts.replace(tzinfo=None)
598
598
  return ts
@@ -1576,10 +1576,22 @@ class ListOfStringsField(AutoTypedField[list[str]]):
1576
1576
  AUTO_TYPE = List(String())
1577
1577
 
1578
1578
 
1579
+ class SetOfStringsField(AutoTypedField[set[str]]):
1580
+ AUTO_TYPE = Set(String())
1581
+
1582
+
1583
+ class ListOfListsOfStringsField(AutoTypedField[list[list[str]]]):
1584
+ AUTO_TYPE = List(List(String()))
1585
+
1586
+
1579
1587
  class DictOfListOfStringsField(AutoTypedField[dict[str, list[str]]]):
1580
1588
  AUTO_TYPE = Dict(List(String()))
1581
1589
 
1582
1590
 
1591
+ class DictOfSetOfIntegersField(AutoTypedField[dict[str, set[int]]]):
1592
+ AUTO_TYPE = Dict(Set(Integer()))
1593
+
1594
+
1583
1595
  class ListOfEnumField(AutoTypedField[list[str]]):
1584
1596
  def __init__(self, valid_values: list[str], **kwargs: Any) -> None:
1585
1597
  self._valid_values = valid_values
@@ -1638,29 +1650,29 @@ class ListOfUUIDField(AutoTypedField[list[str]]):
1638
1650
  AUTO_TYPE = List(UUID())
1639
1651
 
1640
1652
 
1641
- class IPAddressField(AutoTypedField['netaddr.IPAddress']):
1653
+ class IPAddressField(AutoTypedField[netaddr.IPAddress]):
1642
1654
  AUTO_TYPE = IPAddress()
1643
1655
 
1644
1656
 
1645
- class IPV4AddressField(AutoTypedField['netaddr.IPAddress']):
1657
+ class IPV4AddressField(AutoTypedField[netaddr.IPAddress]):
1646
1658
  AUTO_TYPE = IPV4Address()
1647
1659
 
1648
1660
 
1649
- class IPV6AddressField(AutoTypedField['netaddr.IPAddress']):
1661
+ class IPV6AddressField(AutoTypedField[netaddr.IPAddress]):
1650
1662
  AUTO_TYPE = IPV6Address()
1651
1663
 
1652
1664
 
1653
- class IPV4AndV6AddressField(AutoTypedField['netaddr.IPAddress']):
1665
+ class IPV4AndV6AddressField(AutoTypedField[netaddr.IPAddress]):
1654
1666
  AUTO_TYPE = IPV4AndV6Address()
1655
1667
 
1656
1668
 
1657
- class IPNetworkField(AutoTypedField['netaddr.IPNetwork']):
1669
+ class IPNetworkField(AutoTypedField[netaddr.IPNetwork]):
1658
1670
  AUTO_TYPE = IPNetwork()
1659
1671
 
1660
1672
 
1661
- class IPV4NetworkField(AutoTypedField['netaddr.IPNetwork']):
1673
+ class IPV4NetworkField(AutoTypedField[netaddr.IPNetwork]):
1662
1674
  AUTO_TYPE = IPV4Network()
1663
1675
 
1664
1676
 
1665
- class IPV6NetworkField(AutoTypedField['netaddr.IPNetwork']):
1677
+ class IPV6NetworkField(AutoTypedField[netaddr.IPNetwork]):
1666
1678
  AUTO_TYPE = IPV6Network()