lol
This commit is contained in:
@@ -14,6 +14,7 @@ from argparse import Namespace
|
||||
import configparser
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import sys
|
||||
from typing import Any
|
||||
@@ -320,6 +321,10 @@ def _log(opt_str, value, parser):
|
||||
|
||||
|
||||
def _list_dbs(*args):
|
||||
if file_config is None:
|
||||
# assume the current working directory is the one containing the
|
||||
# setup file
|
||||
read_config(Path.cwd())
|
||||
print("Available --db options (use --dburi to override)")
|
||||
for macro in sorted(file_config.options("db")):
|
||||
print("%20s\t%s" % (macro, file_config.get("db", macro)))
|
||||
@@ -420,6 +425,7 @@ def _engine_uri(options, file_config):
|
||||
from sqlalchemy import testing
|
||||
from sqlalchemy.testing import config
|
||||
from sqlalchemy.testing import provision
|
||||
from sqlalchemy.engine import url as sa_url
|
||||
|
||||
if options.dburi:
|
||||
db_urls = list(options.dburi)
|
||||
@@ -444,18 +450,19 @@ def _engine_uri(options, file_config):
|
||||
|
||||
config._current = None
|
||||
|
||||
expanded_urls = list(provision.generate_db_urls(db_urls, extra_drivers))
|
||||
|
||||
for db_url in expanded_urls:
|
||||
log.info("Adding database URL: %s", db_url)
|
||||
|
||||
if options.write_idents and provision.FOLLOWER_IDENT:
|
||||
if options.write_idents and provision.FOLLOWER_IDENT:
|
||||
for db_url in [sa_url.make_url(db_url) for db_url in db_urls]:
|
||||
with open(options.write_idents, "a") as file_:
|
||||
file_.write(
|
||||
f"{provision.FOLLOWER_IDENT} "
|
||||
f"{db_url.render_as_string(hide_password=False)}\n"
|
||||
)
|
||||
|
||||
expanded_urls = list(provision.generate_db_urls(db_urls, extra_drivers))
|
||||
|
||||
for db_url in expanded_urls:
|
||||
log.info("Adding database URL: %s", db_url)
|
||||
|
||||
cfg = provision.setup_config(
|
||||
db_url, options, file_config, provision.FOLLOWER_IDENT
|
||||
)
|
||||
@@ -473,9 +480,6 @@ def _setup_requirements(argument):
|
||||
from sqlalchemy.testing import config
|
||||
from sqlalchemy import testing
|
||||
|
||||
if config.requirements is not None:
|
||||
return
|
||||
|
||||
modname, clsname = argument.split(":")
|
||||
|
||||
# importlib.import_module() only introduced in 2.7, a little
|
||||
|
||||
Reference in New Issue
Block a user