From e832131a881cbc28aa32a0a87de35b0599e8018d Mon Sep 17 00:00:00 2001 From: Dimitrios Christidis Date: Tue, 7 Jan 2025 15:07:21 +0100 Subject: [PATCH] Database: Update template to latest standards #7295 * Remove UTF-8 encoding declaration * Adjust imports to pass Ruff's check * Remove excessive newlines * Format docstrings according to PEP 257 --- lib/rucio/db/sqla/migrate_repo/script.py.mako | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/lib/rucio/db/sqla/migrate_repo/script.py.mako b/lib/rucio/db/sqla/migrate_repo/script.py.mako index 9d5bc1e86f..09eb1450c0 100644 --- a/lib/rucio/db/sqla/migrate_repo/script.py.mako +++ b/lib/rucio/db/sqla/migrate_repo/script.py.mako @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright European Organization for Nuclear Research (CERN) since 2012 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -''' ${message} ''' +"""${message}""" # noqa: D400, D415 import sqlalchemy as sa - from alembic import context from alembic.op import execute @@ -26,34 +24,24 @@ down_revision = ${repr(down_revision)} def upgrade(): - ''' - Upgrade the database to this revision - ''' - + """Upgrade the database to this revision.""" schema = context.get_context().version_table_schema + '.' if context.get_context().version_table_schema else '' if context.get_context().dialect.name == 'oracle': pass - elif context.get_context().dialect.name == 'postgresql': pass - elif context.get_context().dialect.name == 'mysql': pass def downgrade(): - ''' - Downgrade the database to the previous revision - ''' - + """Downgrade the database to the previous revision.""" schema = context.get_context().version_table_schema + '.' if context.get_context().version_table_schema else '' if context.get_context().dialect.name == 'oracle': pass - elif context.get_context().dialect.name == 'postgresql': pass - elif context.get_context().dialect.name == 'mysql': pass