From 7a714a9f294340f7f564aacc24967a2ecbb0ea5a Mon Sep 17 00:00:00 2001 From: Michael Shin Date: Wed, 23 Apr 2025 14:37:14 -0400 Subject: [PATCH] Create the credentials folder if it doesn't exist --- centml/cli/login.py | 2 ++ scripts/lint.sh | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/centml/cli/login.py b/centml/cli/login.py index c68749a..dd4c7ed 100644 --- a/centml/cli/login.py +++ b/centml/cli/login.py @@ -2,6 +2,7 @@ import hashlib from http.server import BaseHTTPRequestHandler, HTTPServer import json +import os import secrets import urllib.parse import webbrowser @@ -122,6 +123,7 @@ def login(token_file): cred = { key: response_dict[key] for key in ("access_token", "refresh_token") if key in response_dict } + os.makedirs(os.path.dirname(settings.CENTML_CRED_FILE_PATH), exist_ok=True) with open(settings.CENTML_CRED_FILE_PATH, "w") as f: json.dump(cred, f) click.echo("✅ Login successful") diff --git a/scripts/lint.sh b/scripts/lint.sh index 9d0f19e..c9cc259 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,4 +1,4 @@ #!/bin/bash -e # run pylint -python -m pylint --rcfile ./scripts/pylintrc -j $(nproc) ./centml ./tests +python -m pylint --rcfile ./scripts/pylintrc ./centml ./tests diff --git a/setup.py b/setup.py index 2bd9f54..e492b88 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name='centml', - version='0.4.0', + version='0.4.1', packages=find_packages(), python_requires=">=3.10", long_description=open('README.md').read(),