Skip to content

Commit

Permalink
support python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
olirice committed Nov 4, 2020
1 parent 33000ec commit 80e9afe
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<a href="https://pypi.org/project/alembic_utils/"><img src="https://img.shields.io/pypi/dm/alembic_utils.svg" alt="Download count" height="18"></a>
</p>
<p>
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.7+-blue.svg" alt="Python version" height="18"></a>
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.6+-blue.svg" alt="Python version" height="18"></a>
<a href=""><img src="https://img.shields.io/badge/postgresql-11+-blue.svg" alt="PostgreSQL version" height="18"></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<a href="https://pypi.org/project/alembic_utils/"><img src="https://img.shields.io/pypi/dm/alembic_utils.svg" alt="Download count" height="18"></a>
</p>
<p>
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.7+-blue.svg" alt="Python version" height="18"></a>
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.6+-blue.svg" alt="Python version" height="18"></a>
<a href=""><img src="https://img.shields.io/badge/postgresql-11+-blue.svg" alt="PostgreSQL version" height="18"></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Quickstart

### Installation
*Requirements* Python 3.7+
*Requirements* Python 3.6+

First, install alembic_utils
```shell
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion src/alembic_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.8"
__version__ = "0.2.9"
6 changes: 2 additions & 4 deletions src/alembic_utils/pg_function.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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"""
Expand Down
5 changes: 2 additions & 3 deletions src/alembic_utils/pg_materialized_view.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# pylint: disable=unused-argument,invalid-name,line-too-long
from __future__ import annotations

from typing import List

Expand All @@ -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
Expand Down Expand Up @@ -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"""
Expand Down
5 changes: 2 additions & 3 deletions src/alembic_utils/pg_view.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# pylint: disable=unused-argument,invalid-name,line-too-long
from __future__ import annotations

from typing import List

Expand All @@ -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)
Expand Down Expand Up @@ -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"""
Expand Down
1 change: 0 additions & 1 deletion src/alembic_utils/replaceable_entity.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# pylint: disable=unused-argument,invalid-name,line-too-long
from __future__ import annotations

import logging
from contextlib import contextmanager
Expand Down

0 comments on commit 80e9afe

Please sign in to comment.