Skip to content

Commit

Permalink
Make postgresql an optional dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
funilrys committed Oct 26, 2024
1 parent 65cd9eb commit 0a88d2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ PyYAML
requests[socks]<3
setuptools>=65.5.1
shtab
SQLAlchemy[postgresql_psycopg2binary]~=2.0
SQLAlchemy~=2.0
2 changes: 1 addition & 1 deletion requirements.win.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ PyYAML
requests<3
setuptools>=65.5.1
shtab
SQLAlchemy[postgresql_psycopg2binary]~=2.0
SQLAlchemy~=2.0
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ def get_requirements(*, mode="standard"):
"docs": ["requirements.docs.txt"],
"test": ["requirements.test.txt"],
"psql": ["requirements.txt"],
"postgresql": ["requirements.txt"],
"psql-binary": ["requirements.txt"],
"postgresql-binary": ["requirements.txt"],
}

if is_win_platform():
Expand Down Expand Up @@ -177,8 +180,10 @@ def get_requirements(*, mode="standard"):

result.add(line)

if mode == "psql":
if mode in ("psql", "postgresql"):
result.add("psycopg2")
elif mode in ("psql-binary", "postgresql-binary"):
result.add("psycopg2-binary")

return list(result)

Expand Down Expand Up @@ -259,6 +264,9 @@ def get_console_scripts(): # pragma: no cover
"dev": get_requirements(mode="dev"),
"test": get_requirements(mode="test"),
"psql": get_requirements(mode="psql"),
"psql-binary": get_requirements(mode="psql-binary"),
"postgresql": get_requirements(mode="postgresql"),
"postgresql-binary": get_requirements(mode="postgresql-binary"),
"full": get_requirements(mode="full"),
},
description="The tool to check the availability or syntax of domain, IP or URL.",
Expand Down

0 comments on commit 0a88d2c

Please sign in to comment.