Skip to content

Commit

Permalink
Add psycopg2 extra, patch psycogreen in entry points.
Browse files Browse the repository at this point in the history
  • Loading branch information
salomon-smekecohen committed May 16, 2024
1 parent 10ce9fa commit d1ae05d
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 12 deletions.
9 changes: 9 additions & 0 deletions bin/baseplate-script
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ from baseplate.server.monkey import patch_stdlib_queues
patch_all()
patch_stdlib_queues()

try:
import psycopg2
from psycogreen.gevent import patch_psycopg

patch_psycopg()
except ImportError:
pass


from baseplate.server import load_and_run_script

load_and_run_script()
9 changes: 9 additions & 0 deletions bin/baseplate-serve
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ from baseplate.server.monkey import patch_stdlib_queues
patch_all()
patch_stdlib_queues()

try:
import psycopg2
from psycogreen.gevent import patch_psycopg

patch_psycopg()
except ImportError:
pass


from baseplate.server import load_app_and_run_server

load_app_and_run_server()
9 changes: 9 additions & 0 deletions bin/baseplate-shell
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ from baseplate.server.monkey import patch_stdlib_queues
patch_all()
patch_stdlib_queues()

try:
import psycopg2
from psycogreen.gevent import patch_psycopg

patch_psycopg()
except ImportError:
pass


from baseplate.server import load_and_run_shell

load_and_run_shell()
9 changes: 9 additions & 0 deletions bin/baseplate-tshell
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ from baseplate.server.monkey import patch_stdlib_queues
patch_all()
patch_stdlib_queues()

try:
import psycopg2
from psycogreen.gevent import patch_psycopg

patch_psycopg()
except ImportError:
pass


from baseplate.server import load_and_run_shell

print("baseplate-tshell has been renamed to baseplate-shell. Please use that in the future!")
Expand Down
15 changes: 3 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ requests = ["advocate"]
s3fetcher = [] # Kept for backwards compatibility, these are now main requirements
sentry = ["sentry-sdk"]
sql = ["sqlalchemy"]
psycopg2 = ["psycopg2", "psycogreen"]
zookeeper = ["kazoo"]

[tool.poetry.group.dev.dependencies]
Expand Down

0 comments on commit d1ae05d

Please sign in to comment.