alembic 1.13.1__tar.gz → 1.13.2__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 (235) hide show
  1. {alembic-1.13.1 → alembic-1.13.2}/LICENSE +2 -2
  2. {alembic-1.13.1 → alembic-1.13.2}/PKG-INFO +1 -1
  3. {alembic-1.13.1 → alembic-1.13.2}/alembic/__init__.py +1 -1
  4. {alembic-1.13.1 → alembic-1.13.2}/alembic/autogenerate/api.py +3 -3
  5. {alembic-1.13.1 → alembic-1.13.2}/alembic/autogenerate/compare.py +1 -1
  6. {alembic-1.13.1 → alembic-1.13.2}/alembic/autogenerate/render.py +25 -15
  7. {alembic-1.13.1 → alembic-1.13.2}/alembic/command.py +24 -15
  8. {alembic-1.13.1 → alembic-1.13.2}/alembic/config.py +5 -10
  9. {alembic-1.13.1 → alembic-1.13.2}/alembic/ddl/_autogen.py +15 -11
  10. {alembic-1.13.1 → alembic-1.13.2}/alembic/ddl/base.py +5 -4
  11. {alembic-1.13.1 → alembic-1.13.2}/alembic/ddl/impl.py +22 -17
  12. {alembic-1.13.1 → alembic-1.13.2}/alembic/ddl/mysql.py +49 -31
  13. {alembic-1.13.1 → alembic-1.13.2}/alembic/ddl/oracle.py +5 -3
  14. {alembic-1.13.1 → alembic-1.13.2}/alembic/ddl/postgresql.py +2 -1
  15. {alembic-1.13.1 → alembic-1.13.2}/alembic/operations/base.py +5 -8
  16. {alembic-1.13.1 → alembic-1.13.2}/alembic/operations/ops.py +5 -5
  17. {alembic-1.13.1 → alembic-1.13.2}/alembic/operations/schemaobj.py +6 -4
  18. {alembic-1.13.1 → alembic-1.13.2}/alembic/runtime/environment.py +5 -7
  19. {alembic-1.13.1 → alembic-1.13.2}/alembic/runtime/migration.py +9 -9
  20. {alembic-1.13.1 → alembic-1.13.2}/alembic/script/base.py +11 -9
  21. {alembic-1.13.1 → alembic-1.13.2}/alembic/script/revision.py +25 -18
  22. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/async/alembic.ini.mako +3 -3
  23. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/generic/alembic.ini.mako +2 -2
  24. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/multidb/alembic.ini.mako +2 -2
  25. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/fixtures.py +20 -8
  26. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/suite/test_autogen_computed.py +1 -0
  27. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/suite/test_environment.py +3 -3
  28. {alembic-1.13.1 → alembic-1.13.2}/alembic/util/langhelpers.py +3 -6
  29. {alembic-1.13.1 → alembic-1.13.2}/alembic/util/messaging.py +9 -3
  30. {alembic-1.13.1 → alembic-1.13.2}/alembic/util/sqla_compat.py +2 -4
  31. {alembic-1.13.1 → alembic-1.13.2}/alembic.egg-info/PKG-INFO +1 -1
  32. {alembic-1.13.1 → alembic-1.13.2}/alembic.egg-info/SOURCES.txt +1 -14
  33. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/autogenerate.rst.txt +8 -0
  34. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/changelog.rst.txt +40 -0
  35. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/front.rst.txt +1 -1
  36. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/basic.css +1 -1
  37. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/doctools.js +1 -1
  38. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/documentation_options.js +1 -1
  39. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/language_data.js +2 -2
  40. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/nature.css +1 -1
  41. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/searchtools.js +105 -60
  42. {alembic-1.13.1 → alembic-1.13.2}/docs/api/autogenerate.html +10 -10
  43. {alembic-1.13.1 → alembic-1.13.2}/docs/api/commands.html +32 -26
  44. {alembic-1.13.1 → alembic-1.13.2}/docs/api/config.html +9 -9
  45. {alembic-1.13.1 → alembic-1.13.2}/docs/api/ddl.html +9 -9
  46. {alembic-1.13.1 → alembic-1.13.2}/docs/api/index.html +9 -9
  47. {alembic-1.13.1 → alembic-1.13.2}/docs/api/operations.html +11 -11
  48. {alembic-1.13.1 → alembic-1.13.2}/docs/api/overview.html +9 -9
  49. {alembic-1.13.1 → alembic-1.13.2}/docs/api/runtime.html +9 -9
  50. {alembic-1.13.1 → alembic-1.13.2}/docs/api/script.html +10 -10
  51. {alembic-1.13.1 → alembic-1.13.2}/docs/autogenerate.html +18 -11
  52. {alembic-1.13.1 → alembic-1.13.2}/docs/batch.html +9 -9
  53. {alembic-1.13.1 → alembic-1.13.2}/docs/branches.html +9 -9
  54. {alembic-1.13.1 → alembic-1.13.2}/docs/build/autogenerate.rst +8 -0
  55. {alembic-1.13.1 → alembic-1.13.2}/docs/build/changelog.rst +40 -0
  56. {alembic-1.13.1 → alembic-1.13.2}/docs/build/conf.py +3 -3
  57. {alembic-1.13.1 → alembic-1.13.2}/docs/build/front.rst +1 -1
  58. {alembic-1.13.1 → alembic-1.13.2}/docs/changelog.html +52 -9
  59. {alembic-1.13.1 → alembic-1.13.2}/docs/cookbook.html +9 -9
  60. {alembic-1.13.1 → alembic-1.13.2}/docs/front.html +10 -10
  61. {alembic-1.13.1 → alembic-1.13.2}/docs/genindex.html +15 -11
  62. {alembic-1.13.1 → alembic-1.13.2}/docs/index.html +14 -9
  63. {alembic-1.13.1 → alembic-1.13.2}/docs/naming.html +9 -9
  64. {alembic-1.13.1 → alembic-1.13.2}/docs/offline.html +9 -9
  65. {alembic-1.13.1 → alembic-1.13.2}/docs/ops.html +14 -14
  66. {alembic-1.13.1 → alembic-1.13.2}/docs/py-modindex.html +9 -9
  67. {alembic-1.13.1 → alembic-1.13.2}/docs/search.html +11 -13
  68. alembic-1.13.2/docs/searchindex.js +1 -0
  69. {alembic-1.13.1 → alembic-1.13.2}/docs/tutorial.html +11 -11
  70. {alembic-1.13.1 → alembic-1.13.2}/pyproject.toml +3 -1
  71. {alembic-1.13.1 → alembic-1.13.2}/setup.cfg +2 -2
  72. {alembic-1.13.1 → alembic-1.13.2}/tests/test_autogen_diffs.py +1 -98
  73. {alembic-1.13.1 → alembic-1.13.2}/tests/test_autogen_indexes.py +5 -4
  74. {alembic-1.13.1 → alembic-1.13.2}/tests/test_autogen_render.py +0 -1
  75. {alembic-1.13.1 → alembic-1.13.2}/tests/test_batch.py +14 -12
  76. {alembic-1.13.1 → alembic-1.13.2}/tests/test_command.py +7 -14
  77. {alembic-1.13.1 → alembic-1.13.2}/tests/test_impl.py +27 -0
  78. alembic-1.13.2/tests/test_messaging.py +30 -0
  79. {alembic-1.13.1 → alembic-1.13.2}/tests/test_mssql.py +4 -3
  80. {alembic-1.13.1 → alembic-1.13.2}/tests/test_postgresql.py +28 -16
  81. {alembic-1.13.1 → alembic-1.13.2}/tests/test_script_production.py +1 -1
  82. {alembic-1.13.1 → alembic-1.13.2}/tests/test_version_traversal.py +0 -2
  83. {alembic-1.13.1 → alembic-1.13.2}/tox.ini +4 -3
  84. alembic-1.13.1/.coveragerc +0 -5
  85. alembic-1.13.1/.github/FUNDING.yml +0 -6
  86. alembic-1.13.1/.github/ISSUE_TEMPLATE/bug_report.md +0 -41
  87. alembic-1.13.1/.github/ISSUE_TEMPLATE/config.yml +0 -15
  88. alembic-1.13.1/.github/ISSUE_TEMPLATE/use_case.md +0 -24
  89. alembic-1.13.1/.github/pull_request_template.md +0 -27
  90. alembic-1.13.1/.github/workflows/run-on-pr.yaml +0 -85
  91. alembic-1.13.1/.github/workflows/run-test.yaml +0 -100
  92. alembic-1.13.1/.gitignore +0 -24
  93. alembic-1.13.1/.gitreview +0 -6
  94. alembic-1.13.1/.pre-commit-config.yaml +0 -31
  95. alembic-1.13.1/docs/build/assets/api_overview.graffle +0 -2795
  96. alembic-1.13.1/docs/build/make.bat +0 -113
  97. alembic-1.13.1/docs/searchindex.js +0 -1
  98. alembic-1.13.1/reap_dbs.py +0 -25
  99. {alembic-1.13.1 → alembic-1.13.2}/CHANGES +0 -0
  100. {alembic-1.13.1 → alembic-1.13.2}/MANIFEST.in +0 -0
  101. {alembic-1.13.1 → alembic-1.13.2}/README.rst +0 -0
  102. {alembic-1.13.1 → alembic-1.13.2}/README.unittests.rst +0 -0
  103. {alembic-1.13.1 → alembic-1.13.2}/alembic/__main__.py +0 -0
  104. {alembic-1.13.1 → alembic-1.13.2}/alembic/autogenerate/__init__.py +0 -0
  105. {alembic-1.13.1 → alembic-1.13.2}/alembic/autogenerate/rewriter.py +0 -0
  106. {alembic-1.13.1 → alembic-1.13.2}/alembic/context.py +0 -0
  107. {alembic-1.13.1 → alembic-1.13.2}/alembic/context.pyi +0 -0
  108. {alembic-1.13.1 → alembic-1.13.2}/alembic/ddl/__init__.py +0 -0
  109. {alembic-1.13.1 → alembic-1.13.2}/alembic/ddl/mssql.py +0 -0
  110. {alembic-1.13.1 → alembic-1.13.2}/alembic/ddl/sqlite.py +0 -0
  111. {alembic-1.13.1 → alembic-1.13.2}/alembic/environment.py +0 -0
  112. {alembic-1.13.1 → alembic-1.13.2}/alembic/migration.py +0 -0
  113. {alembic-1.13.1 → alembic-1.13.2}/alembic/op.py +0 -0
  114. {alembic-1.13.1 → alembic-1.13.2}/alembic/op.pyi +0 -0
  115. {alembic-1.13.1 → alembic-1.13.2}/alembic/operations/__init__.py +0 -0
  116. {alembic-1.13.1 → alembic-1.13.2}/alembic/operations/batch.py +0 -0
  117. {alembic-1.13.1 → alembic-1.13.2}/alembic/operations/toimpl.py +0 -0
  118. {alembic-1.13.1 → alembic-1.13.2}/alembic/py.typed +0 -0
  119. {alembic-1.13.1 → alembic-1.13.2}/alembic/runtime/__init__.py +0 -0
  120. {alembic-1.13.1 → alembic-1.13.2}/alembic/script/__init__.py +0 -0
  121. {alembic-1.13.1 → alembic-1.13.2}/alembic/script/write_hooks.py +0 -0
  122. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/async/README +0 -0
  123. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/async/env.py +0 -0
  124. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/async/script.py.mako +0 -0
  125. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/generic/README +0 -0
  126. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/generic/env.py +0 -0
  127. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/generic/script.py.mako +0 -0
  128. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/multidb/README +0 -0
  129. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/multidb/env.py +0 -0
  130. {alembic-1.13.1 → alembic-1.13.2}/alembic/templates/multidb/script.py.mako +0 -0
  131. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/__init__.py +0 -0
  132. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/assertions.py +0 -0
  133. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/env.py +0 -0
  134. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/plugin/__init__.py +0 -0
  135. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/plugin/bootstrap.py +0 -0
  136. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/requirements.py +0 -0
  137. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/schemacompare.py +0 -0
  138. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/suite/__init__.py +0 -0
  139. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/suite/_autogen_fixtures.py +0 -0
  140. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/suite/test_autogen_comments.py +0 -0
  141. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/suite/test_autogen_diffs.py +0 -0
  142. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/suite/test_autogen_fks.py +0 -0
  143. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/suite/test_autogen_identity.py +0 -0
  144. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/suite/test_op.py +0 -0
  145. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/util.py +0 -0
  146. {alembic-1.13.1 → alembic-1.13.2}/alembic/testing/warnings.py +0 -0
  147. {alembic-1.13.1 → alembic-1.13.2}/alembic/util/__init__.py +0 -0
  148. {alembic-1.13.1 → alembic-1.13.2}/alembic/util/compat.py +0 -0
  149. {alembic-1.13.1 → alembic-1.13.2}/alembic/util/editor.py +0 -0
  150. {alembic-1.13.1 → alembic-1.13.2}/alembic/util/exc.py +0 -0
  151. {alembic-1.13.1 → alembic-1.13.2}/alembic/util/pyfiles.py +0 -0
  152. {alembic-1.13.1 → alembic-1.13.2}/alembic.egg-info/dependency_links.txt +0 -0
  153. {alembic-1.13.1 → alembic-1.13.2}/alembic.egg-info/entry_points.txt +0 -0
  154. {alembic-1.13.1 → alembic-1.13.2}/alembic.egg-info/not-zip-safe +0 -0
  155. {alembic-1.13.1 → alembic-1.13.2}/alembic.egg-info/requires.txt +0 -0
  156. {alembic-1.13.1 → alembic-1.13.2}/alembic.egg-info/top_level.txt +0 -0
  157. {alembic-1.13.1 → alembic-1.13.2}/docs/_images/api_overview.png +0 -0
  158. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/api/autogenerate.rst.txt +0 -0
  159. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/api/commands.rst.txt +0 -0
  160. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/api/config.rst.txt +0 -0
  161. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/api/ddl.rst.txt +0 -0
  162. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/api/index.rst.txt +0 -0
  163. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/api/operations.rst.txt +0 -0
  164. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/api/overview.rst.txt +0 -0
  165. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/api/runtime.rst.txt +0 -0
  166. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/api/script.rst.txt +0 -0
  167. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/batch.rst.txt +0 -0
  168. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/branches.rst.txt +0 -0
  169. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/cookbook.rst.txt +0 -0
  170. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/index.rst.txt +0 -0
  171. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/naming.rst.txt +0 -0
  172. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/offline.rst.txt +0 -0
  173. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/ops.rst.txt +0 -0
  174. {alembic-1.13.1 → alembic-1.13.2}/docs/_sources/tutorial.rst.txt +0 -0
  175. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/changelog.css +0 -0
  176. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/clipboard.min.js +0 -0
  177. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/copybutton.css +0 -0
  178. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/copybutton.js +0 -0
  179. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/copybutton_funcs.js +0 -0
  180. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/file.png +0 -0
  181. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/minus.png +0 -0
  182. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/nature_override.css +0 -0
  183. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/plus.png +0 -0
  184. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/pygments.css +0 -0
  185. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/site_custom_css.css +0 -0
  186. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/sphinx_highlight.js +0 -0
  187. {alembic-1.13.1 → alembic-1.13.2}/docs/_static/sphinx_paramlinks.css +0 -0
  188. {alembic-1.13.1 → alembic-1.13.2}/docs/build/Makefile +0 -0
  189. {alembic-1.13.1 → alembic-1.13.2}/docs/build/_static/nature_override.css +0 -0
  190. {alembic-1.13.1 → alembic-1.13.2}/docs/build/_static/site_custom_css.css +0 -0
  191. {alembic-1.13.1 → alembic-1.13.2}/docs/build/_templates/site_custom_sidebars.html +0 -0
  192. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/api_overview.png +0 -0
  193. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/autogenerate.rst +0 -0
  194. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/commands.rst +0 -0
  195. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/config.rst +0 -0
  196. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/ddl.rst +0 -0
  197. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/index.rst +0 -0
  198. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/operations.rst +0 -0
  199. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/overview.rst +0 -0
  200. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/runtime.rst +0 -0
  201. {alembic-1.13.1 → alembic-1.13.2}/docs/build/api/script.rst +0 -0
  202. {alembic-1.13.1 → alembic-1.13.2}/docs/build/batch.rst +0 -0
  203. {alembic-1.13.1 → alembic-1.13.2}/docs/build/branches.rst +0 -0
  204. {alembic-1.13.1 → alembic-1.13.2}/docs/build/cookbook.rst +0 -0
  205. {alembic-1.13.1 → alembic-1.13.2}/docs/build/index.rst +0 -0
  206. {alembic-1.13.1 → alembic-1.13.2}/docs/build/naming.rst +0 -0
  207. {alembic-1.13.1 → alembic-1.13.2}/docs/build/offline.rst +0 -0
  208. {alembic-1.13.1 → alembic-1.13.2}/docs/build/ops.rst +0 -0
  209. {alembic-1.13.1 → alembic-1.13.2}/docs/build/requirements.txt +0 -0
  210. {alembic-1.13.1 → alembic-1.13.2}/docs/build/tutorial.rst +0 -0
  211. {alembic-1.13.1 → alembic-1.13.2}/docs/build/unreleased/README.txt +0 -0
  212. {alembic-1.13.1 → alembic-1.13.2}/setup.py +0 -0
  213. {alembic-1.13.1 → alembic-1.13.2}/tests/__init__.py +0 -0
  214. {alembic-1.13.1 → alembic-1.13.2}/tests/_large_map.py +0 -0
  215. {alembic-1.13.1 → alembic-1.13.2}/tests/conftest.py +0 -0
  216. {alembic-1.13.1 → alembic-1.13.2}/tests/requirements.py +0 -0
  217. {alembic-1.13.1 → alembic-1.13.2}/tests/test_autogen_composition.py +0 -0
  218. {alembic-1.13.1 → alembic-1.13.2}/tests/test_bulk_insert.py +0 -0
  219. {alembic-1.13.1 → alembic-1.13.2}/tests/test_config.py +0 -0
  220. {alembic-1.13.1 → alembic-1.13.2}/tests/test_editor.py +0 -0
  221. {alembic-1.13.1 → alembic-1.13.2}/tests/test_environment.py +0 -0
  222. {alembic-1.13.1 → alembic-1.13.2}/tests/test_external_dialect.py +0 -0
  223. {alembic-1.13.1 → alembic-1.13.2}/tests/test_mysql.py +0 -0
  224. {alembic-1.13.1 → alembic-1.13.2}/tests/test_offline_environment.py +0 -0
  225. {alembic-1.13.1 → alembic-1.13.2}/tests/test_op.py +0 -0
  226. {alembic-1.13.1 → alembic-1.13.2}/tests/test_op_naming_convention.py +0 -0
  227. {alembic-1.13.1 → alembic-1.13.2}/tests/test_oracle.py +0 -0
  228. {alembic-1.13.1 → alembic-1.13.2}/tests/test_post_write.py +0 -0
  229. {alembic-1.13.1 → alembic-1.13.2}/tests/test_revision.py +0 -0
  230. {alembic-1.13.1 → alembic-1.13.2}/tests/test_script_consumption.py +0 -0
  231. {alembic-1.13.1 → alembic-1.13.2}/tests/test_sqlite.py +0 -0
  232. {alembic-1.13.1 → alembic-1.13.2}/tests/test_stubs.py +0 -0
  233. {alembic-1.13.1 → alembic-1.13.2}/tests/test_suite.py +0 -0
  234. {alembic-1.13.1 → alembic-1.13.2}/tests/test_version_table.py +0 -0
  235. {alembic-1.13.1 → alembic-1.13.2}/tools/write_pyi.py +0 -0
@@ -1,4 +1,4 @@
1
- Copyright 2009-2023 Michael Bayer.
1
+ Copyright 2009-2024 Michael Bayer.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
16
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
17
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
18
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- SOFTWARE.
19
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: alembic
3
- Version: 1.13.1
3
+ Version: 1.13.2
4
4
  Summary: A database migration tool for SQLAlchemy.
5
5
  Home-page: https://alembic.sqlalchemy.org
6
6
  Author: Mike Bayer
@@ -1,4 +1,4 @@
1
1
  from . import context
2
2
  from . import op
3
3
 
4
- __version__ = "1.13.1"
4
+ __version__ = "1.13.2"
@@ -596,9 +596,9 @@ class RevisionContext:
596
596
  migration_script = self.generated_revisions[-1]
597
597
  if not getattr(migration_script, "_needs_render", False):
598
598
  migration_script.upgrade_ops_list[-1].upgrade_token = upgrade_token
599
- migration_script.downgrade_ops_list[
600
- -1
601
- ].downgrade_token = downgrade_token
599
+ migration_script.downgrade_ops_list[-1].downgrade_token = (
600
+ downgrade_token
601
+ )
602
602
  migration_script._needs_render = True
603
603
  else:
604
604
  migration_script._upgrade_ops.append(
@@ -983,7 +983,7 @@ def _normalize_computed_default(sqltext: str) -> str:
983
983
 
984
984
  """
985
985
 
986
- return re.sub(r"[ \(\)'\"`\[\]]", "", sqltext).lower()
986
+ return re.sub(r"[ \(\)'\"`\[\]\t\r\n]", "", sqltext).lower()
987
987
 
988
988
 
989
989
  def _compare_computed_default(
@@ -187,9 +187,11 @@ def _render_create_table_comment(
187
187
  prefix=_alembic_autogenerate_prefix(autogen_context),
188
188
  tname=op.table_name,
189
189
  comment="%r" % op.comment if op.comment is not None else None,
190
- existing="%r" % op.existing_comment
191
- if op.existing_comment is not None
192
- else None,
190
+ existing=(
191
+ "%r" % op.existing_comment
192
+ if op.existing_comment is not None
193
+ else None
194
+ ),
193
195
  schema="'%s'" % op.schema if op.schema is not None else None,
194
196
  indent=" ",
195
197
  )
@@ -216,9 +218,11 @@ def _render_drop_table_comment(
216
218
  return templ.format(
217
219
  prefix=_alembic_autogenerate_prefix(autogen_context),
218
220
  tname=op.table_name,
219
- existing="%r" % op.existing_comment
220
- if op.existing_comment is not None
221
- else None,
221
+ existing=(
222
+ "%r" % op.existing_comment
223
+ if op.existing_comment is not None
224
+ else None
225
+ ),
222
226
  schema="'%s'" % op.schema if op.schema is not None else None,
223
227
  indent=" ",
224
228
  )
@@ -328,9 +332,11 @@ def _add_index(autogen_context: AutogenContext, op: ops.CreateIndexOp) -> str:
328
332
  _get_index_rendered_expressions(index, autogen_context)
329
333
  ),
330
334
  "unique": index.unique or False,
331
- "schema": (", schema=%r" % _ident(index.table.schema))
332
- if index.table.schema
333
- else "",
335
+ "schema": (
336
+ (", schema=%r" % _ident(index.table.schema))
337
+ if index.table.schema
338
+ else ""
339
+ ),
334
340
  "kwargs": ", " + ", ".join(opts) if opts else "",
335
341
  }
336
342
  return text
@@ -592,9 +598,11 @@ def _get_index_rendered_expressions(
592
598
  idx: Index, autogen_context: AutogenContext
593
599
  ) -> List[str]:
594
600
  return [
595
- repr(_ident(getattr(exp, "name", None)))
596
- if isinstance(exp, sa_schema.Column)
597
- else _render_potential_expr(exp, autogen_context, is_index=True)
601
+ (
602
+ repr(_ident(getattr(exp, "name", None)))
603
+ if isinstance(exp, sa_schema.Column)
604
+ else _render_potential_expr(exp, autogen_context, is_index=True)
605
+ )
598
606
  for exp in idx.expressions
599
607
  ]
600
608
 
@@ -1075,9 +1083,11 @@ def _render_check_constraint(
1075
1083
  )
1076
1084
  return "%(prefix)sCheckConstraint(%(sqltext)s%(opts)s)" % {
1077
1085
  "prefix": _sqlalchemy_autogenerate_prefix(autogen_context),
1078
- "opts": ", " + (", ".join("%s=%s" % (k, v) for k, v in opts))
1079
- if opts
1080
- else "",
1086
+ "opts": (
1087
+ ", " + (", ".join("%s=%s" % (k, v) for k, v in opts))
1088
+ if opts
1089
+ else ""
1090
+ ),
1081
1091
  "sqltext": _render_potential_expr(
1082
1092
  constraint.sqltext, autogen_context, wrap_in_text=False
1083
1093
  ),
@@ -49,7 +49,7 @@ def init(
49
49
 
50
50
  :param config: a :class:`.Config` object.
51
51
 
52
- :param directory: string path of the target directory
52
+ :param directory: string path of the target directory.
53
53
 
54
54
  :param template: string name of the migration environment template to
55
55
  use.
@@ -174,7 +174,7 @@ def revision(
174
174
  will be applied to the structure generated by the revision process
175
175
  where it can be altered programmatically. Note that unlike all
176
176
  the other parameters, this option is only available via programmatic
177
- use of :func:`.command.revision`
177
+ use of :func:`.command.revision`.
178
178
 
179
179
  """
180
180
 
@@ -315,9 +315,11 @@ def merge(
315
315
 
316
316
  :param config: a :class:`.Config` instance
317
317
 
318
- :param message: string message to apply to the revision
318
+ :param revisions: The revisions to merge.
319
319
 
320
- :param branch_label: string label name to apply to the new revision
320
+ :param message: string message to apply to the revision.
321
+
322
+ :param branch_label: string label name to apply to the new revision.
321
323
 
322
324
  :param rev_id: hardcoded revision identifier instead of generating a new
323
325
  one.
@@ -370,9 +372,10 @@ def upgrade(
370
372
 
371
373
  :param config: a :class:`.Config` instance.
372
374
 
373
- :param revision: string revision target or range for --sql mode
375
+ :param revision: string revision target or range for --sql mode. May be
376
+ ``"heads"`` to target the most recent revision(s).
374
377
 
375
- :param sql: if True, use ``--sql`` mode
378
+ :param sql: if True, use ``--sql`` mode.
376
379
 
377
380
  :param tag: an arbitrary "tag" that can be intercepted by custom
378
381
  ``env.py`` scripts via the :meth:`.EnvironmentContext.get_tag_argument`
@@ -413,9 +416,10 @@ def downgrade(
413
416
 
414
417
  :param config: a :class:`.Config` instance.
415
418
 
416
- :param revision: string revision target or range for --sql mode
419
+ :param revision: string revision target or range for --sql mode. May
420
+ be ``"base"`` to target the first revision.
417
421
 
418
- :param sql: if True, use ``--sql`` mode
422
+ :param sql: if True, use ``--sql`` mode.
419
423
 
420
424
  :param tag: an arbitrary "tag" that can be intercepted by custom
421
425
  ``env.py`` scripts via the :meth:`.EnvironmentContext.get_tag_argument`
@@ -449,12 +453,13 @@ def downgrade(
449
453
  script.run_env()
450
454
 
451
455
 
452
- def show(config, rev):
456
+ def show(config: Config, rev: str) -> None:
453
457
  """Show the revision(s) denoted by the given symbol.
454
458
 
455
459
  :param config: a :class:`.Config` instance.
456
460
 
457
- :param revision: string revision target
461
+ :param rev: string revision target. May be ``"current"`` to show the
462
+ revision(s) currently applied in the database.
458
463
 
459
464
  """
460
465
 
@@ -484,7 +489,7 @@ def history(
484
489
 
485
490
  :param config: a :class:`.Config` instance.
486
491
 
487
- :param rev_range: string revision range
492
+ :param rev_range: string revision range.
488
493
 
489
494
  :param verbose: output in verbose mode.
490
495
 
@@ -543,7 +548,9 @@ def history(
543
548
  _display_history(config, script, base, head)
544
549
 
545
550
 
546
- def heads(config, verbose=False, resolve_dependencies=False):
551
+ def heads(
552
+ config: Config, verbose: bool = False, resolve_dependencies: bool = False
553
+ ) -> None:
547
554
  """Show current available heads in the script directory.
548
555
 
549
556
  :param config: a :class:`.Config` instance.
@@ -568,7 +575,7 @@ def heads(config, verbose=False, resolve_dependencies=False):
568
575
  )
569
576
 
570
577
 
571
- def branches(config, verbose=False):
578
+ def branches(config: Config, verbose: bool = False) -> None:
572
579
  """Show current branch points.
573
580
 
574
581
  :param config: a :class:`.Config` instance.
@@ -638,7 +645,9 @@ def stamp(
638
645
  :param config: a :class:`.Config` instance.
639
646
 
640
647
  :param revision: target revision or list of revisions. May be a list
641
- to indicate stamping of multiple branch heads.
648
+ to indicate stamping of multiple branch heads; may be ``"base"``
649
+ to remove all revisions from the table or ``"heads"`` to stamp the
650
+ most recent revision(s).
642
651
 
643
652
  .. note:: this parameter is called "revisions" in the command line
644
653
  interface.
@@ -728,7 +737,7 @@ def ensure_version(config: Config, sql: bool = False) -> None:
728
737
 
729
738
  :param config: a :class:`.Config` instance.
730
739
 
731
- :param sql: use ``--sql`` mode
740
+ :param sql: use ``--sql`` mode.
732
741
 
733
742
  .. versionadded:: 1.7.6
734
743
 
@@ -221,8 +221,7 @@ class Config:
221
221
  @overload
222
222
  def get_section(
223
223
  self, name: str, default: None = ...
224
- ) -> Optional[Dict[str, str]]:
225
- ...
224
+ ) -> Optional[Dict[str, str]]: ...
226
225
 
227
226
  # "default" here could also be a TypeVar
228
227
  # _MT = TypeVar("_MT", bound=Mapping[str, str]),
@@ -230,14 +229,12 @@ class Config:
230
229
  @overload
231
230
  def get_section(
232
231
  self, name: str, default: Dict[str, str]
233
- ) -> Dict[str, str]:
234
- ...
232
+ ) -> Dict[str, str]: ...
235
233
 
236
234
  @overload
237
235
  def get_section(
238
236
  self, name: str, default: Mapping[str, str]
239
- ) -> Union[Dict[str, str], Mapping[str, str]]:
240
- ...
237
+ ) -> Union[Dict[str, str], Mapping[str, str]]: ...
241
238
 
242
239
  def get_section(
243
240
  self, name: str, default: Optional[Mapping[str, str]] = None
@@ -313,14 +310,12 @@ class Config:
313
310
  return default
314
311
 
315
312
  @overload
316
- def get_main_option(self, name: str, default: str) -> str:
317
- ...
313
+ def get_main_option(self, name: str, default: str) -> str: ...
318
314
 
319
315
  @overload
320
316
  def get_main_option(
321
317
  self, name: str, default: Optional[str] = None
322
- ) -> Optional[str]:
323
- ...
318
+ ) -> Optional[str]: ...
324
319
 
325
320
  def get_main_option(
326
321
  self, name: str, default: Optional[str] = None
@@ -287,18 +287,22 @@ class _fk_constraint_sig(_constraint_sig[ForeignKeyConstraint]):
287
287
  self.target_table,
288
288
  tuple(self.target_columns),
289
289
  ) + (
290
- (None if onupdate.lower() == "no action" else onupdate.lower())
291
- if onupdate
292
- else None,
293
- (None if ondelete.lower() == "no action" else ondelete.lower())
294
- if ondelete
295
- else None,
290
+ (
291
+ (None if onupdate.lower() == "no action" else onupdate.lower())
292
+ if onupdate
293
+ else None
294
+ ),
295
+ (
296
+ (None if ondelete.lower() == "no action" else ondelete.lower())
297
+ if ondelete
298
+ else None
299
+ ),
296
300
  # convert initially + deferrable into one three-state value
297
- "initially_deferrable"
298
- if initially and initially.lower() == "deferred"
299
- else "deferrable"
300
- if deferrable
301
- else "not deferrable",
301
+ (
302
+ "initially_deferrable"
303
+ if initially and initially.lower() == "deferred"
304
+ else "deferrable" if deferrable else "not deferrable"
305
+ ),
302
306
  )
303
307
 
304
308
  @util.memoized_property
@@ -40,7 +40,6 @@ _ServerDefault = Union["TextClause", "FetchedValue", "Function[Any]", str]
40
40
 
41
41
 
42
42
  class AlterTable(DDLElement):
43
-
44
43
  """Represent an ALTER TABLE statement.
45
44
 
46
45
  Only the string name and optional schema name of the table
@@ -238,9 +237,11 @@ def visit_column_default(
238
237
  return "%s %s %s" % (
239
238
  alter_table(compiler, element.table_name, element.schema),
240
239
  alter_column(compiler, element.column_name),
241
- "SET DEFAULT %s" % format_server_default(compiler, element.default)
242
- if element.default is not None
243
- else "DROP DEFAULT",
240
+ (
241
+ "SET DEFAULT %s" % format_server_default(compiler, element.default)
242
+ if element.default is not None
243
+ else "DROP DEFAULT"
244
+ ),
244
245
  )
245
246
 
246
247
 
@@ -77,7 +77,6 @@ _impls: Dict[str, Type[DefaultImpl]] = {}
77
77
 
78
78
 
79
79
  class DefaultImpl(metaclass=ImplMeta):
80
-
81
80
  """Provide the entrypoint for major migration operations,
82
81
  including database-specific behavioral variances.
83
82
 
@@ -168,16 +167,15 @@ class DefaultImpl(metaclass=ImplMeta):
168
167
  def _exec(
169
168
  self,
170
169
  construct: Union[Executable, str],
171
- execution_options: Optional[dict[str, Any]] = None,
172
- multiparams: Sequence[dict] = (),
173
- params: Dict[str, Any] = util.immutabledict(),
170
+ execution_options: Optional[Mapping[str, Any]] = None,
171
+ multiparams: Optional[Sequence[Mapping[str, Any]]] = None,
172
+ params: Mapping[str, Any] = util.immutabledict(),
174
173
  ) -> Optional[CursorResult]:
175
174
  if isinstance(construct, str):
176
175
  construct = text(construct)
177
176
  if self.as_sql:
178
- if multiparams or params:
179
- # TODO: coverage
180
- raise Exception("Execution arguments not allowed with as_sql")
177
+ if multiparams is not None or params:
178
+ raise TypeError("SQL parameters not allowed with as_sql")
181
179
 
182
180
  compile_kw: dict[str, Any]
183
181
  if self.literal_binds and not isinstance(
@@ -200,11 +198,16 @@ class DefaultImpl(metaclass=ImplMeta):
200
198
  assert conn is not None
201
199
  if execution_options:
202
200
  conn = conn.execution_options(**execution_options)
203
- if params:
204
- assert isinstance(multiparams, tuple)
205
- multiparams += (params,)
206
201
 
207
- return conn.execute(construct, multiparams)
202
+ if params and multiparams is not None:
203
+ raise TypeError(
204
+ "Can't send params and multiparams at the same time"
205
+ )
206
+
207
+ if multiparams:
208
+ return conn.execute(construct, multiparams)
209
+ else:
210
+ return conn.execute(construct, params)
208
211
 
209
212
  def execute(
210
213
  self,
@@ -421,13 +424,15 @@ class DefaultImpl(metaclass=ImplMeta):
421
424
  self._exec(
422
425
  sqla_compat._insert_inline(table).values(
423
426
  **{
424
- k: sqla_compat._literal_bindparam(
425
- k, v, type_=table.c[k].type
426
- )
427
- if not isinstance(
428
- v, sqla_compat._literal_bindparam
427
+ k: (
428
+ sqla_compat._literal_bindparam(
429
+ k, v, type_=table.c[k].type
430
+ )
431
+ if not isinstance(
432
+ v, sqla_compat._literal_bindparam
433
+ )
434
+ else v
429
435
  )
430
- else v
431
436
  for k, v in row.items()
432
437
  }
433
438
  )
@@ -94,21 +94,29 @@ class MySQLImpl(DefaultImpl):
94
94
  column_name,
95
95
  schema=schema,
96
96
  newname=name if name is not None else column_name,
97
- nullable=nullable
98
- if nullable is not None
99
- else existing_nullable
100
- if existing_nullable is not None
101
- else True,
97
+ nullable=(
98
+ nullable
99
+ if nullable is not None
100
+ else (
101
+ existing_nullable
102
+ if existing_nullable is not None
103
+ else True
104
+ )
105
+ ),
102
106
  type_=type_ if type_ is not None else existing_type,
103
- default=server_default
104
- if server_default is not False
105
- else existing_server_default,
106
- autoincrement=autoincrement
107
- if autoincrement is not None
108
- else existing_autoincrement,
109
- comment=comment
110
- if comment is not False
111
- else existing_comment,
107
+ default=(
108
+ server_default
109
+ if server_default is not False
110
+ else existing_server_default
111
+ ),
112
+ autoincrement=(
113
+ autoincrement
114
+ if autoincrement is not None
115
+ else existing_autoincrement
116
+ ),
117
+ comment=(
118
+ comment if comment is not False else existing_comment
119
+ ),
112
120
  )
113
121
  )
114
122
  elif (
@@ -123,21 +131,29 @@ class MySQLImpl(DefaultImpl):
123
131
  column_name,
124
132
  schema=schema,
125
133
  newname=name if name is not None else column_name,
126
- nullable=nullable
127
- if nullable is not None
128
- else existing_nullable
129
- if existing_nullable is not None
130
- else True,
134
+ nullable=(
135
+ nullable
136
+ if nullable is not None
137
+ else (
138
+ existing_nullable
139
+ if existing_nullable is not None
140
+ else True
141
+ )
142
+ ),
131
143
  type_=type_ if type_ is not None else existing_type,
132
- default=server_default
133
- if server_default is not False
134
- else existing_server_default,
135
- autoincrement=autoincrement
136
- if autoincrement is not None
137
- else existing_autoincrement,
138
- comment=comment
139
- if comment is not False
140
- else existing_comment,
144
+ default=(
145
+ server_default
146
+ if server_default is not False
147
+ else existing_server_default
148
+ ),
149
+ autoincrement=(
150
+ autoincrement
151
+ if autoincrement is not None
152
+ else existing_autoincrement
153
+ ),
154
+ comment=(
155
+ comment if comment is not False else existing_comment
156
+ ),
141
157
  )
142
158
  )
143
159
  elif server_default is not False:
@@ -368,9 +384,11 @@ def _mysql_alter_default(
368
384
  return "%s ALTER COLUMN %s %s" % (
369
385
  alter_table(compiler, element.table_name, element.schema),
370
386
  format_column_name(compiler, element.column_name),
371
- "SET DEFAULT %s" % format_server_default(compiler, element.default)
372
- if element.default is not None
373
- else "DROP DEFAULT",
387
+ (
388
+ "SET DEFAULT %s" % format_server_default(compiler, element.default)
389
+ if element.default is not None
390
+ else "DROP DEFAULT"
391
+ ),
374
392
  )
375
393
 
376
394
 
@@ -141,9 +141,11 @@ def visit_column_default(
141
141
  return "%s %s %s" % (
142
142
  alter_table(compiler, element.table_name, element.schema),
143
143
  alter_column(compiler, element.column_name),
144
- "DEFAULT %s" % format_server_default(compiler, element.default)
145
- if element.default is not None
146
- else "DEFAULT NULL",
144
+ (
145
+ "DEFAULT %s" % format_server_default(compiler, element.default)
146
+ if element.default is not None
147
+ else "DEFAULT NULL"
148
+ ),
147
149
  )
148
150
 
149
151
 
@@ -218,7 +218,8 @@ class PostgresqlImpl(DefaultImpl):
218
218
  "join pg_class t on t.oid=d.refobjid "
219
219
  "join pg_attribute a on a.attrelid=t.oid and "
220
220
  "a.attnum=d.refobjsubid "
221
- "where c.relkind='S' and c.relname=:seqname"
221
+ "where c.relkind='S' and "
222
+ "c.oid=cast(:seqname as regclass)"
222
223
  ),
223
224
  seqname=seq_match.group(1),
224
225
  ).first()
@@ -406,8 +406,7 @@ class AbstractOperations(util.ModuleClsProxy):
406
406
  return self.migration_context
407
407
 
408
408
  @overload
409
- def invoke(self, operation: CreateTableOp) -> Table:
410
- ...
409
+ def invoke(self, operation: CreateTableOp) -> Table: ...
411
410
 
412
411
  @overload
413
412
  def invoke(
@@ -427,12 +426,10 @@ class AbstractOperations(util.ModuleClsProxy):
427
426
  DropTableOp,
428
427
  ExecuteSQLOp,
429
428
  ],
430
- ) -> None:
431
- ...
429
+ ) -> None: ...
432
430
 
433
431
  @overload
434
- def invoke(self, operation: MigrateOperation) -> Any:
435
- ...
432
+ def invoke(self, operation: MigrateOperation) -> Any: ...
436
433
 
437
434
  def invoke(self, operation: MigrateOperation) -> Any:
438
435
  """Given a :class:`.MigrateOperation`, invoke it in terms of
@@ -1724,7 +1721,7 @@ class BatchOperations(AbstractOperations):
1724
1721
 
1725
1722
  def create_foreign_key(
1726
1723
  self,
1727
- constraint_name: str,
1724
+ constraint_name: Optional[str],
1728
1725
  referent_table: str,
1729
1726
  local_cols: List[str],
1730
1727
  remote_cols: List[str],
@@ -1774,7 +1771,7 @@ class BatchOperations(AbstractOperations):
1774
1771
  ...
1775
1772
 
1776
1773
  def create_primary_key(
1777
- self, constraint_name: str, columns: List[str]
1774
+ self, constraint_name: Optional[str], columns: List[str]
1778
1775
  ) -> None:
1779
1776
  """Issue a "create primary key" instruction using the
1780
1777
  current batch migration context.
@@ -349,7 +349,7 @@ class CreatePrimaryKeyOp(AddConstraintOp):
349
349
  def batch_create_primary_key(
350
350
  cls,
351
351
  operations: BatchOperations,
352
- constraint_name: str,
352
+ constraint_name: Optional[str],
353
353
  columns: List[str],
354
354
  ) -> None:
355
355
  """Issue a "create primary key" instruction using the
@@ -681,7 +681,7 @@ class CreateForeignKeyOp(AddConstraintOp):
681
681
  def batch_create_foreign_key(
682
682
  cls,
683
683
  operations: BatchOperations,
684
- constraint_name: str,
684
+ constraint_name: Optional[str],
685
685
  referent_table: str,
686
686
  local_cols: List[str],
687
687
  remote_cols: List[str],
@@ -1371,9 +1371,9 @@ class DropTableOp(MigrateOperation):
1371
1371
  info=self.info.copy() if self.info else {},
1372
1372
  prefixes=list(self.prefixes) if self.prefixes else [],
1373
1373
  schema=self.schema,
1374
- _constraints_included=self._reverse._constraints_included
1375
- if self._reverse
1376
- else False,
1374
+ _constraints_included=(
1375
+ self._reverse._constraints_included if self._reverse else False
1376
+ ),
1377
1377
  **self.table_kw,
1378
1378
  )
1379
1379
  return t
@@ -223,10 +223,12 @@ class SchemaObjects:
223
223
  t = sa_schema.Table(name, m, *cols, **kw)
224
224
 
225
225
  constraints = [
226
- sqla_compat._copy(elem, target_table=t)
227
- if getattr(elem, "parent", None) is not t
228
- and getattr(elem, "parent", None) is not None
229
- else elem
226
+ (
227
+ sqla_compat._copy(elem, target_table=t)
228
+ if getattr(elem, "parent", None) is not t
229
+ and getattr(elem, "parent", None) is not None
230
+ else elem
231
+ )
230
232
  for elem in columns
231
233
  if isinstance(elem, (Constraint, Index))
232
234
  ]