alembic 1.14.0__py3-none-any.whl → 1.14.1__py3-none-any.whl

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.
alembic/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from . import context
2
2
  from . import op
3
3
 
4
- __version__ = "1.14.0"
4
+ __version__ = "1.14.1"
@@ -277,7 +277,7 @@ class AutogenContext:
277
277
  """Maintains configuration and state that's specific to an
278
278
  autogenerate operation."""
279
279
 
280
- metadata: Optional[MetaData] = None
280
+ metadata: Union[MetaData, Sequence[MetaData], None] = None
281
281
  """The :class:`~sqlalchemy.schema.MetaData` object
282
282
  representing the destination.
283
283
 
@@ -332,7 +332,7 @@ class AutogenContext:
332
332
  def __init__(
333
333
  self,
334
334
  migration_context: MigrationContext,
335
- metadata: Optional[MetaData] = None,
335
+ metadata: Union[MetaData, Sequence[MetaData], None] = None,
336
336
  opts: Optional[Dict[str, Any]] = None,
337
337
  autogenerate: bool = True,
338
338
  ) -> None:
@@ -831,7 +831,10 @@ def _repr_type(
831
831
 
832
832
  mod = type(type_).__module__
833
833
  imports = autogen_context.imports
834
- if mod.startswith("sqlalchemy.dialects"):
834
+
835
+ if not _skip_variants and sqla_compat._type_has_variants(type_):
836
+ return _render_Variant_type(type_, autogen_context)
837
+ elif mod.startswith("sqlalchemy.dialects"):
835
838
  match = re.match(r"sqlalchemy\.dialects\.(\w+)", mod)
836
839
  assert match is not None
837
840
  dname = match.group(1)
@@ -843,8 +846,6 @@ def _repr_type(
843
846
  return "%s.%r" % (dname, type_)
844
847
  elif impl_rt:
845
848
  return impl_rt
846
- elif not _skip_variants and sqla_compat._type_has_variants(type_):
847
- return _render_Variant_type(type_, autogen_context)
848
849
  elif mod.startswith("sqlalchemy."):
849
850
  if "_render_%s_type" % type_.__visit_name__ in globals():
850
851
  fn = globals()["_render_%s_type" % type_.__visit_name__]
alembic/ddl/postgresql.py CHANGED
@@ -16,6 +16,7 @@ from typing import TYPE_CHECKING
16
16
  from typing import Union
17
17
 
18
18
  from sqlalchemy import Column
19
+ from sqlalchemy import Float
19
20
  from sqlalchemy import literal_column
20
21
  from sqlalchemy import Numeric
21
22
  from sqlalchemy import text
@@ -132,7 +133,7 @@ class PostgresqlImpl(DefaultImpl):
132
133
  metadata_default = metadata_column.server_default.arg
133
134
 
134
135
  if isinstance(metadata_default, str):
135
- if not isinstance(inspector_column.type, Numeric):
136
+ if not isinstance(inspector_column.type, (Numeric, Float)):
136
137
  metadata_default = re.sub(r"^'|'$", "", metadata_default)
137
138
  metadata_default = f"'{metadata_default}'"
138
139
 
alembic/ddl/sqlite.py CHANGED
@@ -16,6 +16,8 @@ from sqlalchemy import schema
16
16
  from sqlalchemy import sql
17
17
 
18
18
  from .base import alter_table
19
+ from .base import ColumnName
20
+ from .base import format_column_name
19
21
  from .base import format_table_name
20
22
  from .base import RenameTable
21
23
  from .impl import DefaultImpl
@@ -207,6 +209,15 @@ def visit_rename_table(
207
209
  )
208
210
 
209
211
 
212
+ @compiles(ColumnName, "sqlite")
213
+ def visit_column_name(element: ColumnName, compiler: DDLCompiler, **kw) -> str:
214
+ return "%s RENAME COLUMN %s TO %s" % (
215
+ alter_table(compiler, element.table_name, element.schema),
216
+ format_column_name(compiler, element.column_name),
217
+ format_column_name(compiler, element.newname),
218
+ )
219
+
220
+
210
221
  # @compiles(AddColumn, 'sqlite')
211
222
  # def visit_add_column(element, compiler, **kw):
212
223
  # return "%s %s" % (
@@ -15,7 +15,7 @@ prepend_sys_path = .
15
15
 
16
16
  # timezone to use when rendering the date within the migration file
17
17
  # as well as the filename.
18
- # If specified, requires the python>=3.9 or backports.zoneinfo library.
18
+ # If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
19
19
  # Any required deps can installed by adding `alembic[tz]` to the pip requirements
20
20
  # string value is passed to ZoneInfo()
21
21
  # leave blank for localtime
@@ -48,7 +48,9 @@ prepend_sys_path = .
48
48
  # version_path_separator = ;
49
49
  # version_path_separator = space
50
50
  # version_path_separator = newline
51
- version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
51
+ #
52
+ # Use os.pathsep. Default configuration used for new projects.
53
+ version_path_separator = os
52
54
 
53
55
  # set to 'true' to search source files recursively
54
56
  # in each "version_locations" directory
@@ -17,7 +17,7 @@ prepend_sys_path = .
17
17
 
18
18
  # timezone to use when rendering the date within the migration file
19
19
  # as well as the filename.
20
- # If specified, requires the python>=3.9 or backports.zoneinfo library.
20
+ # If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
21
21
  # Any required deps can installed by adding `alembic[tz]` to the pip requirements
22
22
  # string value is passed to ZoneInfo()
23
23
  # leave blank for localtime
@@ -50,7 +50,9 @@ prepend_sys_path = .
50
50
  # version_path_separator = ;
51
51
  # version_path_separator = space
52
52
  # version_path_separator = newline
53
- version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
53
+ #
54
+ # Use os.pathsep. Default configuration used for new projects.
55
+ version_path_separator = os
54
56
 
55
57
  # set to 'true' to search source files recursively
56
58
  # in each "version_locations" directory
@@ -17,7 +17,7 @@ prepend_sys_path = .
17
17
 
18
18
  # timezone to use when rendering the date within the migration file
19
19
  # as well as the filename.
20
- # If specified, requires the python>=3.9 or backports.zoneinfo library.
20
+ # If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
21
21
  # Any required deps can installed by adding `alembic[tz]` to the pip requirements
22
22
  # string value is passed to ZoneInfo()
23
23
  # leave blank for localtime
@@ -50,7 +50,9 @@ prepend_sys_path = .
50
50
  # version_path_separator = ;
51
51
  # version_path_separator = space
52
52
  # version_path_separator = newline
53
- version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
53
+ #
54
+ # Use os.pathsep. Default configuration used for new projects.
55
+ version_path_separator = os
54
56
 
55
57
  # set to 'true' to search source files recursively
56
58
  # in each "version_locations" directory
alembic/util/compat.py CHANGED
@@ -24,6 +24,7 @@ if True:
24
24
 
25
25
  is_posix = os.name == "posix"
26
26
 
27
+ py313 = sys.version_info >= (3, 13)
27
28
  py311 = sys.version_info >= (3, 11)
28
29
  py310 = sys.version_info >= (3, 10)
29
30
  py39 = sys.version_info >= (3, 9)
@@ -1,4 +1,4 @@
1
- Copyright 2009-2024 Michael Bayer.
1
+ Copyright 2009-2025 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
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: alembic
3
- Version: 1.14.0
3
+ Version: 1.14.1
4
4
  Summary: A database migration tool for SQLAlchemy.
5
5
  Home-page: https://alembic.sqlalchemy.org
6
6
  Author: Mike Bayer
@@ -28,13 +28,14 @@ Classifier: Topic :: Database :: Front-Ends
28
28
  Requires-Python: >=3.8
29
29
  Description-Content-Type: text/x-rst
30
30
  License-File: LICENSE
31
- Requires-Dist: SQLAlchemy >=1.3.0
31
+ Requires-Dist: SQLAlchemy>=1.3.0
32
32
  Requires-Dist: Mako
33
- Requires-Dist: typing-extensions >=4
34
- Requires-Dist: importlib-metadata ; python_version < "3.9"
35
- Requires-Dist: importlib-resources ; python_version < "3.9"
33
+ Requires-Dist: importlib-metadata; python_version < "3.9"
34
+ Requires-Dist: importlib-resources; python_version < "3.9"
35
+ Requires-Dist: typing-extensions>=4
36
36
  Provides-Extra: tz
37
- Requires-Dist: backports.zoneinfo ; (python_version < "3.9") and extra == 'tz'
37
+ Requires-Dist: backports.zoneinfo; python_version < "3.9" and extra == "tz"
38
+ Requires-Dist: tzdata; extra == "tz"
38
39
 
39
40
  Alembic is a database migrations tool written by the author
40
41
  of `SQLAlchemy <http://www.sqlalchemy.org>`_. A migrations tool
@@ -1,4 +1,4 @@
1
- alembic/__init__.py,sha256=qw_qYmTjOKiGcs--x0c6kjZo70tQTR5m8_lqF98Qr_0,63
1
+ alembic/__init__.py,sha256=cdCZTWAIlk-sWQ6BPu9FEdV7AUyFJpTFU1bwmzWvqTo,63
2
2
  alembic/__main__.py,sha256=373m7-TBh72JqrSMYviGrxCHZo-cnweM8AGF8A22PmY,78
3
3
  alembic/command.py,sha256=2tkKrIoEgPfXrGgvMRGrUXH4l-7z466DOxd7Q2XOfL8,22169
4
4
  alembic/config.py,sha256=BZ7mwFRk2gq8GFNxxy9qvMUFx43YbDbQTC99OnjqiKY,22216
@@ -10,9 +10,9 @@ alembic/op.py,sha256=flHtcsVqOD-ZgZKK2pv-CJ5Cwh-KJ7puMUNXzishxLw,167
10
10
  alembic/op.pyi,sha256=QZ1ERetxIrpZNTyg48Btn5OJhhpMId-_MLMP36RauOw,50168
11
11
  alembic/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  alembic/autogenerate/__init__.py,sha256=ntmUTXhjLm4_zmqIwyVaECdpPDn6_u1yM9vYk6-553E,543
13
- alembic/autogenerate/api.py,sha256=Bh-37G0PSFeT9WSfEQ-3TZoainXGLL2nsl4okv_xYc0,22173
13
+ alembic/autogenerate/api.py,sha256=L4qkapSJO1Ypymx8HsjLl0vFFt202agwMYsQbIe6ZtI,22219
14
14
  alembic/autogenerate/compare.py,sha256=cdUBH6qsedaJsnToSOu4MfcJaI4bjUJ4VWqtBlqsSr8,44944
15
- alembic/autogenerate/render.py,sha256=YB3C90rq7XDhjTia9GAnK6yfnVVzCROziZrbArmG9SE,35481
15
+ alembic/autogenerate/render.py,sha256=JUjXpAmxhO-WPJGgvs0V_xtEC0Tpv0AngDepVfPIWUc,35482
16
16
  alembic/autogenerate/rewriter.py,sha256=uZWRkTYJoncoEJ5WY1QBRiozjyChqZDJPy4LtcRibjM,7846
17
17
  alembic/ddl/__init__.py,sha256=Df8fy4Vn_abP8B7q3x8gyFwEwnLw6hs2Ljt_bV3EZWE,152
18
18
  alembic/ddl/_autogen.py,sha256=Blv2RrHNyF4cE6znCQXNXG5T9aO-YmiwD4Fz-qfoaWA,9275
@@ -21,8 +21,8 @@ alembic/ddl/impl.py,sha256=7-oxMb7KeycaK96x-kXw4mR6NSE1tmN0UEZIZrPcuhY,30195
21
21
  alembic/ddl/mssql.py,sha256=ydvgBSaftKYjaBaMyqius66Ta4CICQSj79Og3Ed2atY,14219
22
22
  alembic/ddl/mysql.py,sha256=kXOGYmpnL_9WL3ijXNsG4aAwy3m1HWJOoLZSePzmJF0,17316
23
23
  alembic/ddl/oracle.py,sha256=669YlkcZihlXFbnXhH2krdrvDry8q5pcUGfoqkg_R6Y,6243
24
- alembic/ddl/postgresql.py,sha256=GNCnx-N8UsCIstfW49J8ivYcKgRB8KFNPRgNtORC_AM,29883
25
- alembic/ddl/sqlite.py,sha256=wLXhb8bJWRspKQTb-iVfepR4LXYgOuEbUWKX5qwDhIQ,7570
24
+ alembic/ddl/postgresql.py,sha256=OR9ufFDr-uvzIBk38OBsLlfr_PXG9qBSDYIj0-oNnwc,29921
25
+ alembic/ddl/sqlite.py,sha256=yR1ov010h3HIpJvZbCLTkR7HIkKQMfEAGJE7ZnLwmSU,7980
26
26
  alembic/operations/__init__.py,sha256=e0KQSZAgLpTWvyvreB7DWg7RJV_MWSOPVDgCqsd2FzY,318
27
27
  alembic/operations/base.py,sha256=JRaOtPqyqfaPjzGHxuP9VMcO1KsJNmbbLOvwG82qxGA,74474
28
28
  alembic/operations/batch.py,sha256=YqtD4hJ3_RkFxvI7zbmBwxcLEyLHYyWQpsz4l5L85yI,26943
@@ -37,15 +37,15 @@ alembic/script/base.py,sha256=XLNpdsLnBBSz4ZKMFUArFUdtL1HcjtuUDHNbA-5VlZA,37809
37
37
  alembic/script/revision.py,sha256=NTu-eu5Y78u4NoVXpT0alpD2oL40SGATA2sEMEf1el4,62306
38
38
  alembic/script/write_hooks.py,sha256=NGB6NGgfdf7HK6XNNpSKqUCfzxazj-NRUePgFx7MJSM,5036
39
39
  alembic/templates/async/README,sha256=ISVtAOvqvKk_5ThM5ioJE-lMkvf9IbknFUFVU_vPma4,58
40
- alembic/templates/async/alembic.ini.mako,sha256=lw_6ie1tMbYGpbvE7MnzJvx101RbSTh9uu4t9cvDpug,3638
40
+ alembic/templates/async/alembic.ini.mako,sha256=lYN5fP_fIX3FWtTcOy86Xznr6P5r1f0rlkdDhxLhVN4,3658
41
41
  alembic/templates/async/env.py,sha256=zbOCf3Y7w2lg92hxSwmG1MM_7y56i_oRH4AKp0pQBYo,2389
42
42
  alembic/templates/async/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
43
43
  alembic/templates/generic/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
44
- alembic/templates/generic/alembic.ini.mako,sha256=YcwTOEoiZr663Gkt6twCjmaqZao0n6xjRl0B5prK79s,3746
44
+ alembic/templates/generic/alembic.ini.mako,sha256=TPnqGqwg9QG8uCvBY5jaz32U2pqVqLK1dG1e8i2yDYM,3766
45
45
  alembic/templates/generic/env.py,sha256=TLRWOVW3Xpt_Tpf8JFzlnoPn_qoUu8UV77Y4o9XD6yI,2103
46
46
  alembic/templates/generic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
47
47
  alembic/templates/multidb/README,sha256=dWLDhnBgphA4Nzb7sNlMfCS3_06YqVbHhz-9O5JNqyI,606
48
- alembic/templates/multidb/alembic.ini.mako,sha256=AW1OGb-QezxBY5mynSWW7b1lGKnh9sVPImfGgfXf2EM,3840
48
+ alembic/templates/multidb/alembic.ini.mako,sha256=cVrikS0KRB46GVcjSO8xKYm7rqUngqTnd06pCozm1Pw,3860
49
49
  alembic/templates/multidb/env.py,sha256=6zNjnW8mXGUk7erTsAvrfhvqoczJ-gagjVq1Ypg2YIQ,4230
50
50
  alembic/templates/multidb/script.py.mako,sha256=N06nMtNSwHkgl0EBXDyMt8njp9tlOesR583gfq21nbY,1090
51
51
  alembic/testing/__init__.py,sha256=kOxOh5nwmui9d-_CCq9WA4Udwy7ITjm453w74CTLZDo,1159
@@ -68,16 +68,16 @@ alembic/testing/suite/test_autogen_identity.py,sha256=kcuqngG7qXAKPJDX4U8sRzPKHE
68
68
  alembic/testing/suite/test_environment.py,sha256=OwD-kpESdLoc4byBrGrXbZHvqtPbzhFCG4W9hJOJXPQ,11877
69
69
  alembic/testing/suite/test_op.py,sha256=2XQCdm_NmnPxHGuGj7hmxMzIhKxXNotUsKdACXzE1mM,1343
70
70
  alembic/util/__init__.py,sha256=KSZ7UT2YzH6CietgUtljVoE3QnGjoFKOi7RL5sgUxrk,1688
71
- alembic/util/compat.py,sha256=RjHdQa1NomU3Zlvgfvza0OMiSRQSLRL3xVl3OdUy2UE,2594
71
+ alembic/util/compat.py,sha256=eoR9ReCTV_l0xGgGlr_OJmVvJecttBYXRKfDhoK8zKU,2630
72
72
  alembic/util/editor.py,sha256=JIz6_BdgV8_oKtnheR6DZoB7qnrHrlRgWjx09AsTsUw,2546
73
73
  alembic/util/exc.py,sha256=KQTru4zcgAmN4IxLMwLFS56XToUewaXB7oOLcPNjPwg,98
74
74
  alembic/util/langhelpers.py,sha256=LpOcovnhMnP45kTt8zNJ4BHpyQrlF40OL6yDXjqKtsE,10026
75
75
  alembic/util/messaging.py,sha256=BxAHiJsYHBPb2m8zv4yaueSRAlVuYXWkRCeN02JXhqw,3250
76
76
  alembic/util/pyfiles.py,sha256=zltVdcwEJJCPS2gHsQvkHkQakuF6wXiZ6zfwHbGNT0g,3489
77
77
  alembic/util/sqla_compat.py,sha256=XMfZaLdbVbJoniNUyI3RUUXu4gCWljjVBbJ7db6vCgc,19526
78
- alembic-1.14.0.dist-info/LICENSE,sha256=zhnnuit3ylhLgqZ5KFbhOOswsxHIlrB2wJpAXuRfvuk,1059
79
- alembic-1.14.0.dist-info/METADATA,sha256=5hNrxl9umF2WKbNL-MxyMUEZem8-OxRa49Qz9w7jqzo,7390
80
- alembic-1.14.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
81
- alembic-1.14.0.dist-info/entry_points.txt,sha256=aykM30soxwGN0pB7etLc1q0cHJbL9dy46RnK9VX4LLw,48
82
- alembic-1.14.0.dist-info/top_level.txt,sha256=FwKWd5VsPFC8iQjpu1u9Cn-JnK3-V1RhUCmWqz1cl-s,8
83
- alembic-1.14.0.dist-info/RECORD,,
78
+ alembic-1.14.1.dist-info/LICENSE,sha256=NeqcNBmyYfrxvkSMT0fZJVKBv2s2tf_qVQUiJ9S6VN4,1059
79
+ alembic-1.14.1.dist-info/METADATA,sha256=D5AHibKWuwgPf9ORQhNm0k_iTmpKrkDNF-MboIrflY8,7420
80
+ alembic-1.14.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
81
+ alembic-1.14.1.dist-info/entry_points.txt,sha256=aykM30soxwGN0pB7etLc1q0cHJbL9dy46RnK9VX4LLw,48
82
+ alembic-1.14.1.dist-info/top_level.txt,sha256=FwKWd5VsPFC8iQjpu1u9Cn-JnK3-V1RhUCmWqz1cl-s,8
83
+ alembic-1.14.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5