Skip to content

Commit

Permalink
Merge branch 'main' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsy0dev authored Apr 17, 2024
2 parents 62ac4f4 + df1aacd commit 6047e7b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
40 changes: 24 additions & 16 deletions poetry.lock

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

14 changes: 7 additions & 7 deletions pufferblow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

# Pre-init the config handler and the config model
# TODO: Find a better to do this
config_handler = ConfigHandler()
config_handler = ConfigHandler()

if not config_handler.check_config():
logger.error(errors.ERROR_NO_CONFIG_FILE_FOUND(config_handler.config_file_path))
Expand All @@ -47,7 +47,7 @@
config=config_handler.load_config()
)

@cli.command()
cli.command()
def version():
""" PufferBlow's API version """
print(f"[bold cyan]pufferblow [reset]{constants.VERSION}")
Expand All @@ -65,7 +65,7 @@ def serve(
if log_level > 3:
console.log("[bold red] [ ? ] [reset]The log level is set too high (max is 3).")
sys.exit(1)

# Check if the database exists or not
database_uri = Database._create_database_uri(
username=pufferblow_api_config.USERNAME,
Expand All @@ -81,12 +81,12 @@ def serve(
logger.error("The specified database does not exist. Please verify the database name and connection details.")
sys.exit(1)

log_level = constants.log_level_map[log_level]
log_level_str = constants.log_level_map[log_level]

INTERCEPT_HANDLER = InterceptHandler()
logging.basicConfig(handlers=[INTERCEPT_HANDLER], level=log_level)
logging.basicConfig(handlers=[INTERCEPT_HANDLER], level=log_level_str)
logging.root.handlers = [INTERCEPT_HANDLER]
logging.root.setLevel(log_level)
logging.root.setLevel(log_level_str)

SEEN = set()

Expand All @@ -106,7 +106,7 @@ def serve(
logger.configure(handlers=[{"sink": sys.stdout}])
logger.add(pufferblow_api_config.LOGS_PATH, rotation="10 MB")

StubbedGunicornLogger.log_level = log_level
StubbedGunicornLogger.log_level = log_level_str

OPTIONS = {
"bind": f"{pufferblow_api_config.API_HOST}:{pufferblow_api_config.API_PORT}",
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ packages = [
[tool.poetry.dependencies]
python = "^3.10"
fastapi = "^0.110.0"
typer = "^0.10.0"
typer = "^0.12.3"
rich = "^13.7.1"
uvicorn = "^0.29.0"
pycryptodome = "^3.19.0"
Expand All @@ -28,15 +28,15 @@ tomli = "^2.0.1"
httpx = "^0.27.0"
sphinx = "^7.2.6"
sphinx-book-theme = "^1.1.2"
sphinx-autobuild = "^2024.2.4"
sphinx-autobuild = "^2024.4.13"
sphinx-favicon = "^1.0.1"
myst-parser = "^2.0.0"
orjson = "^3.9.15"
sqlalchemy-utils = "^0.41.1"
sqlalchemy-utils = "^0.41.2"
orjson = "^3.10.0"

[tool.poetry.group.dev.dependencies]
loguru = "^0.7.2"
gunicorn = "^21.2.0"
gunicorn = "^22.0.0"

[tool.poetry.plugins."console_scripts"]
pufferblow-api = "pufferblow:cli.run"
Expand Down

0 comments on commit 6047e7b

Please sign in to comment.