Skip to content

Commit

Permalink
migrate to use black as opinionated auto formater
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim authored and kpsherva committed Jun 9, 2022
1 parent 13eb9f0 commit 3a865bc
Show file tree
Hide file tree
Showing 111 changed files with 1,519 additions and 2,014 deletions.
9 changes: 0 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# Python files
[*.py]
indent_size = 4
# isort plugin configuration
known_first_party = invenio_vocabularies
multi_line_output = 2
default_section = THIRDPARTY
skip = .eggs

# RST files (used by sphinx)
[*.rst]
indent_size = 4
Expand Down
14 changes: 7 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
master_doc = "index"

# General information about the project.
project = u"Invenio-Vocabularies"
copyright = u"2020, CERN"
author = u"CERN"
project = "Invenio-Vocabularies"
copyright = "2020, CERN"
author = "CERN"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -248,8 +248,8 @@
(
master_doc,
"invenio-vocabularies.tex",
u"invenio-vocabularies Documentation",
u"CERN",
"invenio-vocabularies Documentation",
"CERN",
"manual",
),
]
Expand Down Expand Up @@ -283,7 +283,7 @@
(
master_doc,
"invenio-vocabularies",
u"invenio-vocabularies Documentation",
"invenio-vocabularies Documentation",
[author],
1,
)
Expand All @@ -302,7 +302,7 @@
(
master_doc,
"invenio-vocabularies",
u"Invenio-Vocabularies Documentation",
"Invenio-Vocabularies Documentation",
author,
"invenio-vocabularies",
"Invenio module for managing vocabularies.",
Expand Down
42 changes: 19 additions & 23 deletions invenio_vocabularies/alembic/17c703ce1eb7_create_names_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,42 @@
from sqlalchemy.dialects import mysql, postgresql

# revision identifiers, used by Alembic.
revision = '17c703ce1eb7'
down_revision = '4a9a4fd235f8'
revision = "17c703ce1eb7"
down_revision = "4a9a4fd235f8"
branch_labels = ()
depends_on = None


def upgrade():
"""Upgrade database."""
op.create_table(
'name_metadata',
"name_metadata",
sa.Column(
'created',
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'),
nullable=False
"created",
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), "mysql"),
nullable=False,
),
sa.Column(
'updated',
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'),
nullable=False
"updated",
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), "mysql"),
nullable=False,
),
sa.Column("id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
sa.Column(
'id',
sqlalchemy_utils.types.uuid.UUIDType(),
nullable=False
),
sa.Column(
'json',
"json",
sa.JSON()
.with_variant(sqlalchemy_utils.types.json.JSONType(), 'mysql')
.with_variant(sqlalchemy_utils.types.json.JSONType(), "mysql")
.with_variant(
postgresql.JSONB(none_as_null=True, astext_type=sa.Text()),
'postgresql')
.with_variant(sqlalchemy_utils.types.json.JSONType(), 'sqlite'),
nullable=True
postgresql.JSONB(none_as_null=True, astext_type=sa.Text()), "postgresql"
)
.with_variant(sqlalchemy_utils.types.json.JSONType(), "sqlite"),
nullable=True,
),
sa.Column('version_id', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_name_metadata'))
sa.Column("version_id", sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint("id", name=op.f("pk_name_metadata")),
)


def downgrade():
"""Downgrade database."""
op.drop_table('name_metadata')
op.drop_table("name_metadata")
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
from alembic import op

# revision identifiers, used by Alembic.
revision = '4a9a4fd235f8'
down_revision = '6312f33645c1'
revision = "4a9a4fd235f8"
down_revision = "6312f33645c1"
branch_labels = ()
depends_on = None


def upgrade():
"""Upgrade database."""
op.create_table(
'vocabularies_schemes',
sa.Column('id', sa.String(), nullable=False),
sa.Column('parent_id', sa.String(), nullable=False),
sa.Column('name', sa.String(), nullable=True),
sa.Column('uri', sa.String(), nullable=True),
"vocabularies_schemes",
sa.Column("id", sa.String(), nullable=False),
sa.Column("parent_id", sa.String(), nullable=False),
sa.Column("name", sa.String(), nullable=True),
sa.Column("uri", sa.String(), nullable=True),
sa.PrimaryKeyConstraint(
'id', 'parent_id', name=op.f('pk_vocabularies_schemes')
)
"id", "parent_id", name=op.f("pk_vocabularies_schemes")
),
)


def downgrade():
"""Downgrade database."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('vocabularies_schemes')
op.drop_table("vocabularies_schemes")
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def upgrade():
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), "mysql"),
nullable=False,
),
sa.Column(
"id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=False
),
sa.Column("id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
sa.Column(
"json",
sa.JSON()
Expand All @@ -63,9 +61,7 @@ def upgrade():
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), "mysql"),
nullable=False,
),
sa.Column(
"id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=False
),
sa.Column("id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
sa.Column(
"json",
sa.JSON()
Expand All @@ -85,9 +81,7 @@ def upgrade():
sa.Column("id", sa.String(), nullable=False),
sa.Column("pid_type", sa.String(), nullable=True),
sa.PrimaryKeyConstraint("id", name=op.f("pk_vocabularies_types")),
sa.UniqueConstraint(
"pid_type", name=op.f("uq_vocabularies_types_pid_type")
),
sa.UniqueConstraint("pid_type", name=op.f("uq_vocabularies_types_pid_type")),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,42 @@
from sqlalchemy.dialects import mysql, postgresql

# revision identifiers, used by Alembic.
revision = '6312f33645c1'
down_revision = '4f365fced43f'
revision = "6312f33645c1"
down_revision = "4f365fced43f"
branch_labels = ()
depends_on = None


def upgrade():
"""Upgrade database."""
op.create_table(
'affiliation_metadata',
"affiliation_metadata",
sa.Column(
'created',
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'),
nullable=False
"created",
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), "mysql"),
nullable=False,
),
sa.Column(
'updated',
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'),
nullable=False
"updated",
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), "mysql"),
nullable=False,
),
sa.Column("id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
sa.Column(
'id',
sqlalchemy_utils.types.uuid.UUIDType(),
nullable=False
),
sa.Column(
'json',
"json",
sa.JSON()
.with_variant(sqlalchemy_utils.types.json.JSONType(), 'mysql')
.with_variant(sqlalchemy_utils.types.json.JSONType(), "mysql")
.with_variant(
postgresql.JSONB(none_as_null=True, astext_type=sa.Text()),
'postgresql')
.with_variant(sqlalchemy_utils.types.json.JSONType(), 'sqlite'),
nullable=True
postgresql.JSONB(none_as_null=True, astext_type=sa.Text()), "postgresql"
)
.with_variant(sqlalchemy_utils.types.json.JSONType(), "sqlite"),
nullable=True,
),
sa.Column('version_id', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_affiliation_metadata'))
sa.Column("version_id", sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint("id", name=op.f("pk_affiliation_metadata")),
)


def downgrade():
"""Downgrade database."""
op.drop_table('affiliation_metadata')
op.drop_table("affiliation_metadata")
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,46 @@
from sqlalchemy.dialects import mysql, postgresql

# revision identifiers, used by Alembic.
revision = '676dd587542d'
down_revision = '17c703ce1eb7'
revision = "676dd587542d"
down_revision = "17c703ce1eb7"
branch_labels = ()
depends_on = None


def upgrade():
"""Upgrade database."""
op.create_table(
'funder_metadata',
"funder_metadata",
sa.Column(
'created',
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'),
nullable=False
"created",
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), "mysql"),
nullable=False,
),
sa.Column(
'updated',
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'),
nullable=False
"updated",
sa.DateTime().with_variant(mysql.DATETIME(fsp=6), "mysql"),
nullable=False,
),
sa.Column("id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
sa.Column(
'id',
sqlalchemy_utils.types.uuid.UUIDType(),
nullable=False
),
sa.Column(
'json',
"json",
sa.JSON()
.with_variant(sqlalchemy_utils.types.json.JSONType(), 'mysql')
.with_variant(sqlalchemy_utils.types.json.JSONType(), "mysql")
.with_variant(
postgresql.JSONB(none_as_null=True, astext_type=sa.Text()),
'postgresql'
).with_variant(sqlalchemy_utils.types.json.JSONType(), 'sqlite'),
nullable=True
postgresql.JSONB(none_as_null=True, astext_type=sa.Text()), "postgresql"
)
.with_variant(sqlalchemy_utils.types.json.JSONType(), "sqlite"),
nullable=True,
),
sa.Column('version_id', sa.Integer(), nullable=False),
sa.Column('pid', sa.String(), nullable=True),
sa.PrimaryKeyConstraint('id', name=op.f('pk_funder_metadata')),
sa.UniqueConstraint('pid', name=op.f('uq_funder_metadata_pid'))
sa.Column("version_id", sa.Integer(), nullable=False),
sa.Column("pid", sa.String(), nullable=True),
sa.PrimaryKeyConstraint("id", name=op.f("pk_funder_metadata")),
sa.UniqueConstraint("pid", name=op.f("uq_funder_metadata_pid")),
)
# ### end Alembic commands ###


def downgrade():
"""Downgrade database."""
op.drop_table('funder_metadata')
op.drop_table("funder_metadata")
# ### end Alembic commands ###
Loading

0 comments on commit 3a865bc

Please sign in to comment.