From 80e9afe267177502ad17ee18b5e649de4816d1b3 Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Wed, 4 Nov 2020 06:14:34 -0600 Subject: [PATCH] support python 3.6 --- .github/workflows/test.yml | 4 ++-- README.md | 2 +- docs/index.md | 2 +- docs/quickstart.md | 2 +- setup.py | 2 +- src/alembic_utils/__init__.py | 2 +- src/alembic_utils/pg_function.py | 6 ++---- src/alembic_utils/pg_materialized_view.py | 5 ++--- src/alembic_utils/pg_view.py | 5 ++--- src/alembic_utils/replaceable_entity.py | 1 - 10 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97fe020..b4d0f58 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,10 +22,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.7 + - name: Set up Python 3.6 uses: actions/setup-python@v1 with: - python-version: 3.7 + python-version: 3.6 - name: Install run: | pip install --upgrade pip diff --git a/README.md b/README.md index 80d2c54..3546bea 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Download count

- Python version + Python version PostgreSQL version

diff --git a/docs/index.md b/docs/index.md index 1bcbbae..7f31059 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,7 +18,7 @@ Download count

- Python version + Python version PostgreSQL version

diff --git a/docs/quickstart.md b/docs/quickstart.md index fdbde43..3bfc5e8 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -1,7 +1,7 @@ ## Quickstart ### Installation -*Requirements* Python 3.7+ +*Requirements* Python 3.6+ First, install alembic_utils ```shell diff --git a/setup.py b/setup.py index 85eee62..4de359d 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def get_version(package): author_email="oliver@oliverrice.com", license="MIT", description="A sqlalchemy/alembic extension for migrating procedures and views ", - python_requires=">=3.7", + python_requires=">=3.6", packages=find_packages("src"), package_dir={"": "src"}, install_requires=["alembic", "psycopg2-binary", "flupy", "sqlalchemy", "parse"], diff --git a/src/alembic_utils/__init__.py b/src/alembic_utils/__init__.py index c49a95c..75cf783 100644 --- a/src/alembic_utils/__init__.py +++ b/src/alembic_utils/__init__.py @@ -1 +1 @@ -__version__ = "0.2.8" +__version__ = "0.2.9" diff --git a/src/alembic_utils/pg_function.py b/src/alembic_utils/pg_function.py index da0dff0..0e2d16e 100644 --- a/src/alembic_utils/pg_function.py +++ b/src/alembic_utils/pg_function.py @@ -1,6 +1,4 @@ # pylint: disable=unused-argument,invalid-name,line-too-long -from __future__ import annotations - from typing import List from parse import parse @@ -22,7 +20,7 @@ class PGFunction(ReplaceableEntity): """ @classmethod - def from_sql(cls, sql: str) -> PGFunction: + def from_sql(cls, sql: str) -> "PGFunction": """Create an instance instance from a SQL string""" template = "create{}function{:s}{schema}.{signature}{:s}returns{:s}{definition}" result = parse(template, sql.strip(), case_sensitive=False) @@ -85,7 +83,7 @@ def to_sql_statement_create_or_replace(self) -> str: ) @classmethod - def from_database(cls, connection, schema) -> List[PGFunction]: + def from_database(cls, connection, schema) -> List["PGFunction"]: """Get a list of all functions defined in the db""" sql = sql_text( f""" diff --git a/src/alembic_utils/pg_materialized_view.py b/src/alembic_utils/pg_materialized_view.py index 4abc2dc..262e319 100644 --- a/src/alembic_utils/pg_materialized_view.py +++ b/src/alembic_utils/pg_materialized_view.py @@ -1,5 +1,4 @@ # pylint: disable=unused-argument,invalid-name,line-too-long -from __future__ import annotations from typing import List @@ -26,7 +25,7 @@ def __init__(self, schema: str, signature: str, definition: str, with_data: bool self.with_data = with_data @classmethod - def from_sql(cls, sql: str) -> PGMaterializedView: + def from_sql(cls, sql: str) -> "PGMaterializedView": """Create an instance from a SQL string""" # Strip optional semicolon and all whitespace from end of definition @@ -89,7 +88,7 @@ def to_sql_statement_create_or_replace(self) -> str: ) @classmethod - def from_database(cls, connection, schema) -> List[PGMaterializedView]: + def from_database(cls, connection, schema) -> List["PGMaterializedView"]: """Get a list of all functions defined in the db""" sql = sql_text( f""" diff --git a/src/alembic_utils/pg_view.py b/src/alembic_utils/pg_view.py index f7f8d87..3a4623c 100644 --- a/src/alembic_utils/pg_view.py +++ b/src/alembic_utils/pg_view.py @@ -1,5 +1,4 @@ # pylint: disable=unused-argument,invalid-name,line-too-long -from __future__ import annotations from typing import List @@ -21,7 +20,7 @@ class PGView(ReplaceableEntity): """ @classmethod - def from_sql(cls, sql: str) -> PGView: + def from_sql(cls, sql: str) -> "PGView": """Create an instance from a SQL string""" template = "create{}view{:s}{schema}.{signature}{:s}as{:s}{definition}" result = parse(template, sql, case_sensitive=False) @@ -54,7 +53,7 @@ def to_sql_statement_create_or_replace(self) -> str: ) @classmethod - def from_database(cls, connection, schema) -> List[PGView]: + def from_database(cls, connection, schema) -> List["PGView"]: """Get a list of all functions defined in the db""" sql = sql_text( f""" diff --git a/src/alembic_utils/replaceable_entity.py b/src/alembic_utils/replaceable_entity.py index c6502fa..6a7e6f6 100644 --- a/src/alembic_utils/replaceable_entity.py +++ b/src/alembic_utils/replaceable_entity.py @@ -1,5 +1,4 @@ # pylint: disable=unused-argument,invalid-name,line-too-long -from __future__ import annotations import logging from contextlib import contextmanager