Commit 32846c39 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Moved app_fastapi to app.

parent aa321ca9
......@@ -27,9 +27,9 @@ from nomad.utils import strip, create_uuid
from nomad.datamodel import Dataset as DatasetDefinitionCls
from nomad.doi import DOI
from nomad.app_fastapi.routers.auth import get_required_user
from nomad.app_fastapi.utils import create_responses
from nomad.app_fastapi.models import (
from import get_required_user
from import create_responses
from import (
pagination_parameters, Pagination, PaginationResponse, Query,
HTTPExceptionModel, User, Direction, Owner)
......@@ -29,9 +29,9 @@ from nomad.utils import strip
from nomad.archive import (
query_archive, ArchiveQueryError, compute_required_with_referenced,
read_partial_archives_from_mongo, filter_archive)
from nomad.app_fastapi.utils import create_streamed_zipfile, File, create_responses
from nomad.app_fastapi.routers.auth import get_optional_user
from nomad.app_fastapi.models import (
from import create_streamed_zipfile, File, create_responses
from import get_optional_user
from import (
Pagination, WithQuery, MetadataRequired, EntriesMetadataResponse, EntriesMetadata,
EntryMetadataResponse, query_parameters, metadata_required_parameters, Files, Query,
pagination_parameters, files_parameters, User, Owner, HTTPExceptionModel, EntriesRaw,
......@@ -18,9 +18,9 @@
from fastapi import Depends, APIRouter, status
from nomad.app_fastapi.routers.auth import get_required_user
from nomad.app_fastapi.models import User, HTTPExceptionModel
from nomad.app_fastapi.utils import create_responses
from import get_required_user
from import User, HTTPExceptionModel
from import create_responses
from nomad.utils import strip
router = APIRouter()
......@@ -27,7 +27,7 @@ def migrate(mongo_db: str):
import pymongo
import sys
from nomad import config, processing as proc, doi as nomad_doi, datamodel, infrastructure
from nomad.app_fastapi.flask.api.mirror import _upload_data
from import _upload_data
from nomad.cli.client.mirror import v0Dot7, fix_time, _Dataset
from bson.json_util import dumps
......@@ -47,7 +47,7 @@ def run_app(**kwargs):
from uvicorn import Server, Config
uv_config = Config(
'nomad.app_fastapi.main:app', host='',
'', host='',, log_level='info')
server = Server(config=uv_config)
......@@ -18,7 +18,7 @@
from flask_restplus import fields
from nomad.app_fastapi.flask.common import RFC3339DateTime
from import RFC3339DateTime
from .metainfo import Section, Quantity, Datetime, Capitalized, MEnum
......@@ -528,7 +528,7 @@ def unwarp_task(task, cls_name, self_id, *args, **kwargs):
self = cls.get(self_id)
except KeyError as e:
from nomad.app_fastapi import flask
from import flask
# This only happens in tests, where it is not always avoidable that
# tasks from old test-cases bleed over.
......@@ -31,8 +31,8 @@ from nomad.datamodel.material import Material
from nomad import config, datamodel, infrastructure, utils
from nomad.metainfo.search_extension import ( # pylint: disable=unused-import
search_quantities, metrics, order_default_quantities, groups)
from nomad.app_fastapi import models as api_models
from nomad.app_fastapi.models import (
from import models as api_models
from import (
Pagination, PaginationResponse, Query, MetadataRequired, SearchResponse, Aggregation,
Statistic, StatisticResponse, AggregationOrderType, AggregationResponse, AggregationDataItem)
......@@ -3,4 +3,4 @@ python -m nomad.cli admin ops gui-config
[ -e gunicorn.conf ] && params+=(--config gunicorn.conf)
[ -e gunicorn.log.conf ] && params+=(--log-config gunicorn.log.conf)
python -m "${params[@]}" --worker-class=uvicorn.workers.UvicornWorker -b nomad.app_fastapi.main:app
python -m "${params[@]}" --worker-class=uvicorn.workers.UvicornWorker -b
......@@ -23,7 +23,7 @@ from datetime import datetime
from nomad import infrastructure, config
from nomad.archive import write_partial_archive_to_mongo
from nomad.app_fastapi.main import app
from import app
from nomad.datamodel import EntryArchive, EntryMetadata, DFTMetadata, User
......@@ -19,7 +19,7 @@
import pytest
from bravado.client import SwaggerClient
from nomad.app_fastapi.flask import app as flask_app
from import app as flask_app
from .bravado import FlaskTestHttpClient
from ..conftest import admin_user_auth, test_user_auth # pylint: disable=unused-import
......@@ -23,7 +23,7 @@ error handling, etc.
from flask_restplus import Resource
from nomad.app_fastapi.flask.api.api import api
from import api
ns = api.namespace('test', description='Only used for tests.')
......@@ -30,8 +30,8 @@ import base64
import itertools
from hashlib import md5
from nomad.app_fastapi.flask.common import rfc3339DateTime
from nomad.app_fastapi.flask.api.auth import generate_upload_token
from import rfc3339DateTime
from import generate_upload_token
from nomad import search, files, config, utils, infrastructure
from nomad.metainfo import search_extension
from nomad.files import UploadFiles, PublicUploadFiles
......@@ -25,7 +25,7 @@ from nomad import config
from nomad.cli import cli
from nomad import processing as proc, infrastructure
from tests.app_fastapi.flask.test_app import BlueprintClient
from import BlueprintClient
silicon_id = "fh3UBjhUVm4nxzeRd2JJuqw5oXYa"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment