-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
91 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[pycodestyle] | ||
max-line-length = 80 | ||
max-line-length = 100 | ||
exclude = docs/*,build/*,venv/* | ||
|
||
[pydocstyle] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""pscypog2 Compatibility module.""" | ||
from typing import Any | ||
from platform import python_implementation | ||
|
||
|
||
try: | ||
import psycopg2 | ||
except ImportError: | ||
psycopg2 = False | ||
|
||
# pylint:disable=unused-import | ||
if not psycopg2: | ||
# if there's no postgres, just go with the flow. | ||
# pylint:disable=invalid-name | ||
cursor = Any | ||
connection = Any | ||
elif python_implementation() == "PyPy": | ||
# pylint:disable=import-error | ||
from psycopg2cffi._impl.cursor import Cursor as cursor | ||
from psycopg2cffi._impl.connection import Connection as connection | ||
else: | ||
from psycopg2._psycopg import cursor, connection # pylint:disable=no-name-in-module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters