diff --git a/nunaserver/nunaserver/generator.py b/nunaserver/nunaserver/generator.py index 4f69934..4acb3bb 100644 --- a/nunaserver/nunaserver/generator.py +++ b/nunaserver/nunaserver/generator.py @@ -10,8 +10,7 @@ import typing from typing import List from pathlib import Path -from pydsdl import read_namespace -from pydsdl._error import InvalidDefinitionError +from pydsdl import read_namespace, InvalidDefinitionError from nunavut import build_namespace_tree from nunavut import DSDLCodeGenerator, SupportGenerator, AbstractGenerator, Namespace from nunaserver import settings diff --git a/nunaserver/nunaserver/logging.py b/nunaserver/nunaserver/logging.py index 8178e78..2a97005 100644 --- a/nunaserver/nunaserver/logging.py +++ b/nunaserver/nunaserver/logging.py @@ -19,9 +19,7 @@ def init_logging(): log_handler = logging.FileHandler(log_file) loggers = [logging.getLogger()] - loggers = loggers + [ - logging.getLogger(name) for name in logging.root.manager.loggerDict - ] + loggers = loggers + [logging.getLogger(name) for name in logging.root.manager.loggerDict] for logger in loggers: logger.setLevel(settings.LOG_LEVEL) logger.addHandler(log_handler) diff --git a/nunaserver/nunaserver/pyproject.toml b/nunaserver/nunaserver/pyproject.toml new file mode 100644 index 0000000..92ba34e --- /dev/null +++ b/nunaserver/nunaserver/pyproject.toml @@ -0,0 +1,9 @@ +# -------------------------------------------------- BLACK -------------------------------------------------- +[tool.black] +line-length = 120 +target-version = ['py311'] +include = ''' +(nunaserver/.*\.pyi?$) +| +(noxfile.py$) +''' diff --git a/nunaserver/nunaserver/utils/archive_utils.py b/nunaserver/nunaserver/utils/archive_utils.py index 9db1705..b1f72c8 100644 --- a/nunaserver/nunaserver/utils/archive_utils.py +++ b/nunaserver/nunaserver/utils/archive_utils.py @@ -41,9 +41,7 @@ def fetch_remote_namespace(url: str, arch_dir: Path): raise RuntimeError("Only zip archives and Github are supported.") if res.status_code != http.HTTPStatus.OK: - raise RuntimeError( - f"Could not download the archive; HTTP error {res.status_code}" - ) + raise RuntimeError(f"Could not download the archive; HTTP error {res.status_code}") fd, file_path = tempfile.mkstemp("dsdlarchive") @@ -71,7 +69,4 @@ def zipdir(path, ziph): def allowed_file(filename): - return ( - "." in filename - and filename.rsplit(".", 1)[1].lower() in settings.ALLOWED_EXTENSIONS - ) + return "." in filename and filename.rsplit(".", 1)[1].lower() in settings.ALLOWED_EXTENSIONS diff --git a/nunaserver/nunaserver/views.py b/nunaserver/nunaserver/views.py index f70740e..8481038 100644 --- a/nunaserver/nunaserver/views.py +++ b/nunaserver/nunaserver/views.py @@ -64,12 +64,7 @@ def upload(): # Kick off Celery task to generate DSDL task = generate_dsdl.delay( - build_uuid, - form.archive_urls, - form.target_lang, - form.target_endian, - form.flags, - form.doc_url + build_uuid, form.archive_urls, form.target_lang, form.target_endian, form.flags, form.doc_url ) return (