Skip to content

[Backend Dependencies Update] Update alembic to 1.2.1#719

Closed
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-alembic-1.0.10-to-1.2.1
Closed

[Backend Dependencies Update] Update alembic to 1.2.1#719
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-alembic-1.0.10-to-1.2.1

Conversation

@pyup-bot
Copy link
Copy Markdown
Collaborator

This PR updates alembic from 1.0.10 to 1.2.1.

Changelog

1.2.1

:released: September 24, 2019

 .. change::
     :tags: bug, command
     :tickets: 601

     Reverted the name change of the "revisions" argument to
     :func:`.command.stamp` to "revision" as apparently applications are
     calling upon this argument as a keyword name.  Pull request courtesy
     Thomas Bechtold.  Special translations are also added to the command
     line interface so that it is still known as "revisions" in the CLI.

 .. change::
     :tags: bug, tests
     :tickets: 592

     Removed the "test requirements" from "setup.py test", as this command now
     only emits a removal error in any case and these requirements are unused.

.. changelog::

1.2.0

:released: September 20, 2019

 .. change::
     :tags: feature, command
     :tickets: 473

     Added new ``--purge`` flag to the ``alembic stamp`` command, which will
     unconditionally erase the version table before stamping anything.  This is
     useful for development where non-existent version identifiers might be left
     within the table.  Additionally, ``alembic.stamp`` now supports a list of
     revision identifiers, which are intended to allow setting up muliple heads
     at once.  Overall handling of version identifiers within the
     ``alembic.stamp`` command has been improved with many new tests and
     use cases added.

 .. change::
     :tags: bug, autogenerate
     :tickets: 550

     Improved the Python rendering of a series of migration operations such that
     a single "pass" is rendered for a :class:`.UpgradeOps` or
     :class:`.DowngradeOps` based on if no lines of Python code actually
     rendered under the operation, rather than whether or not sub-directives
     exist. Removed extra "pass" lines that would generate from the
     :class:`.ModifyTableOps` directive so that these aren't duplicated under
     operation rewriting scenarios.


 .. change::
     :tags: feature, runtime
     :tickets: 123

     Added new feature :meth:`.MigrationContext.autocommit_block`, a special
     directive which will provide for a non-transactional block inside of a
     migration script. The feature requres that: the database driver
     (e.g. DBAPI) supports the AUTOCOMMIT isolation mode.  The directive
     also necessarily needs to COMMIT the existing transaction in progress
     in order to enter autocommit mode.

     .. seealso::

         :meth:`.MigrationContext.autocommit_block`

 .. change::
     :tags: change: py3k

     Python 3.4 support is dropped, as the upstream tooling (pip, mysqlclient)
     etc are already dropping support for Python 3.4, which itself is no longer
     maintained.

 .. change::
     :tags: usecase, autogenerate
     :tickets: 518

     Added autogenerate support for :class:`.Column` objects that have
     dialect-specific ``**kwargs``, support first added in SQLAlchemy 1.3.
     This includes SQLite "on conflict" as well as options used by some
     third party dialects.

 .. change::
     :tags: usecase, autogenerate
     :tickets: 131

     Added rendering for SQLAlchemy ``Variant`` datatypes, which render as the
     base type plus one or more ``.with_variant()`` method calls.


 .. change::
     :tags: usecase, commands
     :tickets: 534

     Made the command interface revision lookup behavior more strict in that an
     Alembic revision number is only resolved based on a partial match rules if
     it has at least four characters, to prevent simple typographical issues
     from inadvertently  running migrations.

  .. change::
     :tags: feature, commands
     :tickets: 307

     Added "post write hooks" to revision generation.  These allow custom logic
     to run after a revision Python script is generated, typically for the
     purpose of running code formatters such as "Black" or "autopep8", but may
     be used for any arbitrary post-render hook as well, including custom Python
     functions or scripts.  The hooks are enabled by providing a
     ``[post_write_hooks]`` section in the alembic.ini file.  A single hook
     is provided which runs an arbitrary Python executable on the newly
     generated revision script, which can be configured to run code formatters
     such as Black; full examples are included in the documentation.

     .. seealso::

         :ref:`post_write_hooks`


 .. change::
     :tags: feature, environment
     :tickets: 463

     Added new flag ``--package`` to ``alembic init``.  For environments where
     the Alembic migration files and such are within the package tree and
     importable as modules, this flag can be specified which will add the
     additional ``__init__.py`` files in the version location and the
     environment location.

 .. change::
     :tags: bug, autogenerate
     :tickets: 549

     Fixed bug where rendering of comment text for table-level comments  within
     :meth:`.Operations.create_table_comment` and
     :meth:`.Operations.drop_table_comment` was not properly quote-escaped
     within rendered Python code for autogenerate.

 .. change::
     :tags: bug, autogenerate
     :tickets: 505

     Modified the logic of the :class:`.Rewriter` object such that it keeps a
     memoization of which directives it has processed, so that it can ensure it
     processes a particular directive only once, and additionally fixed
     :class:`.Rewriter` so that it functions correctly for multiple-pass
     autogenerate schemes, such as the one illustrated in the "multidb"
     template.  By tracking which directives have been processed, a
     multiple-pass scheme which calls upon the :class:`.Rewriter` multiple times
     for the same structure as elements are added can work without running
     duplicate operations on the same elements more than once.

.. changelog::

1.1.0

:released: August 26, 2019

 .. change::
     :tags: change

     Alembic 1.1 bumps the minimum version of SQLAlchemy to 1.1.   As was the
     case before, Python requirements remain at Python 2.7, or in the 3.x series
     Python 3.4.

 .. change::
     :tags: change, internals

     The test suite for Alembic now makes use of SQLAlchemy's testing framework
     directly.  Previously, Alembic had its own version of this framework that
     was mostly copied from that of SQLAlchemy to enable testing with older
     SQLAlchemy versions.  The majority of this code is now removed so that both
     projects can leverage improvements from a common testing framework.

 .. change::
     :tags: bug, commands
     :tickets: 562

     Fixed bug where the double-percent logic applied to some dialects such as
     psycopg2 would be rendered in ``--sql`` mode, by allowing dialect options
     to be passed through to the dialect used to generate SQL and then providing
     ``paramstyle="named"`` so that percent signs need not be doubled.   For
     users having this issue, existing env.py scripts need to add
     ``dialect_opts={"paramstyle": "named"}`` to their offline
     context.configure().  See the ``alembic/templates/generic/env.py`` template
     for an example.

 .. change::
     :tags: bug, py3k

     Fixed use of the deprecated "imp" module, which is used to detect  pep3147
     availability as well as to locate .pyc files, which started  emitting
     deprecation warnings during the test suite.   The warnings were not being
     emitted earlier during the test suite, the change is possibly due to
     changes in py.test itself but this is not clear. The check for pep3147 is
     set to True for any Python version 3.5 or greater now and importlib is used
     when available.  Note that some dependencies such as distutils may still be
     emitting this warning. Tests are adjusted to accommodate for dependencies
     that emit the warning as well.


 .. change::
     :tags: bug, mysql
     :tickets: 594

     Fixed issue where emitting a change of column name for MySQL did not
     preserve the column comment, even if it were specified as existing_comment.


 .. change::
     :tags: bug, setup
     :tickets: 592

     Removed the "python setup.py test" feature in favor of a straight run of
     "tox".   Per Pypa / pytest developers, "setup.py" commands are in general
     headed towards deprecation in favor of tox.  The tox.ini script has been
     updated such that running "tox" with no arguments will perform a single run
     of the test suite against the default installed Python interpreter.

     .. seealso::

         https://github.com/pypa/setuptools/issues/1684

         https://github.com/pytest-dev/pytest/issues/5534

 .. change::
     :tags: usecase, commands
     :tickets: 571

     The "alembic init" command will now proceed if the target directory exists
     as long as it's still empty.  Previously, it would not proceed if the
     directory existed. The new behavior is modeled from what git does, to
     accommodate for container or other deployments where an Alembic target
     directory may need to be already mounted instead of being created with
     alembic init.  Pull request courtesy Aviskar KC.



.. changelog::

1.0.11

:released: June 25, 2019

 .. change::
     :tags: bug, sqlite, autogenerate, batch
     :tickets: 579

     SQLite server default reflection will ensure parenthesis are surrounding a
     column default expression that is detected as being a non-constant
     expression, such as a ``datetime()`` default, to accommodate for the
     requirement that SQL expressions have to be parenthesized when being sent
     as DDL.  Parenthesis are not added to constant expressions to allow for
     maximum cross-compatibility with other dialects and existing test suites
     (such as Alembic's), which necessarily entails scanning the expression to
     eliminate for constant numeric and string values. The logic is added to the
     two "reflection->DDL round trip" paths which are currently autogenerate and
     batch migration.  Within autogenerate, the logic is on the rendering side,
     whereas in batch the logic is installed as a column reflection hook.


 .. change::
     :tags: bug, sqlite, autogenerate
     :tickets: 579

     Improved SQLite server default comparison to accommodate for a ``text()``
     construct that added parenthesis directly vs. a construct that relied
     upon the SQLAlchemy SQLite dialect to render the parenthesis, as well
     as improved support for various forms of constant expressions such as
     values that are quoted vs. non-quoted.


 .. change::
     :tags: bug, autogenerate

     Fixed bug where the "literal_binds" flag was not being set when
     autogenerate would create a server default value, meaning server default
     comparisons would fail for functions that contained literal values.

 .. change::
    :tags: bug, mysql
    :tickets: 554

    Added support for MySQL "DROP CHECK", which is added as of MySQL 8.0.16,
    separate from MariaDB's "DROP CONSTRAINT" for CHECK constraints.  The MySQL
    Alembic implementation now checks for "MariaDB" in server_version_info to
    decide which one to use.



 .. change::
     :tags: bug, mysql, operations
     :tickets: 564

     Fixed issue where MySQL databases need to use CHANGE COLUMN when altering a
     server default of CURRENT_TIMESTAMP, NOW() and probably other functions
     that are only usable with DATETIME/TIMESTAMP columns.  While MariaDB
     supports both CHANGE and ALTER COLUMN in this case, MySQL databases only
     support CHANGE.  So the new logic is that if the server default change is
     against a DateTime-oriented column, the CHANGE format is used
     unconditionally, as in the vast majority of cases the server default is to
     be CURRENT_TIMESTAMP which may also be potentially bundled with an "ON
     UPDATE CURRENT_TIMESTAMP" directive, which SQLAlchemy does not currently
     support as a distinct field.  The fix addiionally improves the server
     default comparison logic when the "ON UPDATE" clause is present and
     there are parenthesis to be adjusted for as is the case on some MariaDB
     versions.



 .. change::
     :tags: bug, environment

     Warnings emitted by Alembic now include a default stack level of 2, and in
     some cases it's set to 3, in order to help warnings indicate more closely
     where they are originating from.  Pull request courtesy Ash Berlin-Taylor.


 .. change::
     :tags: bug, py3k
     :tickets: 563

     Replaced the Python compatbility routines for ``getargspec()`` with a fully
     vendored version based on ``getfullargspec()`` from Python 3.3.
     Originally, Python was emitting deprecation warnings for this function in
     Python 3.8 alphas.  While this change was reverted, it was observed that
     Python 3 implementations for ``getfullargspec()`` are an order of magnitude
     slower as of the 3.4 series where it was rewritten against ``Signature``.
     While Python plans to improve upon this situation, SQLAlchemy projects for
     now are using a simple replacement to avoid any future issues.


.. changelog::
Links

@pyup-bot
Copy link
Copy Markdown
Collaborator Author

Closing this in favor of #749

@pyup-bot pyup-bot closed this Oct 31, 2019
@jpowie01 jpowie01 deleted the pyup-update-alembic-1.0.10-to-1.2.1 branch October 31, 2019 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant