diff --git a/pephub/routers/api/v1/namespace.py b/pephub/routers/api/v1/namespace.py index 33fa5f5a..127f118b 100644 --- a/pephub/routers/api/v1/namespace.py +++ b/pephub/routers/api/v1/namespace.py @@ -212,44 +212,6 @@ async def create_pep( status_code=400, ) - # # create temp dir that gets deleted when we're done - # with tempfile.TemporaryDirectory() as dirpath: - # config_file_name = "project_config.yaml" - # sample_table_name = BLANK_PEP_CONFIG["sample_table"] - # - # # create 'empty' config and sample table files - # with open(f"{dirpath}/{config_file_name}", "w") as cfg_fh: - # cfg_fh.write(json.dumps(BLANK_PEP_CONFIG)) - # with open(f"{dirpath}/{sample_table_name}", "w") as cfg_fh: - # cfg_fh.write(BLANK_PEP_SAMPLE_TABLE) - # - # # init project - # p = Project(f"{dirpath}/{config_file_name}") - # try: - # agent.project.create( - # p, - # namespace=namespace, - # name=name, - # tag=tag, - # description=description, - # is_private=is_private, - # pep_schema=pep_schema, - # ) - # except ProjectUniqueNameError as _: - # raise HTTPException( - # detail=f"Project '{namespace}/{p.name}:{tag}' already exists in namespace", - # status_code=400, - # ) - # return JSONResponse( - # content={ - # "namespace": namespace, - # "name": name, - # "tag": tag, - # "registry_path": f"{namespace}/{name}:{tag}", - # }, - # status_code=202, - # ) - @namespace.post( "/projects/json", diff --git a/pephub/routers/api/v1/user.py b/pephub/routers/api/v1/user.py deleted file mode 100644 index d4250006..00000000 --- a/pephub/routers/api/v1/user.py +++ /dev/null @@ -1,62 +0,0 @@ -# from platform import python_version -# -# from fastapi import APIRouter, Depends, Request -# from fastapi.responses import JSONResponse, RedirectResponse -# from fastapi.templating import Jinja2Templates -# from pepdbagent import PEPDatabaseAgent -# -# from ...._version import __version__ as pephub_version -# from ....const import BASE_TEMPLATES_PATH -# from ....dependencies import get_db, read_authorization_header -# -# user = APIRouter(prefix="/api/v1/me", tags=["profile"]) -# -# templates = Jinja2Templates(directory=BASE_TEMPLATES_PATH) -# -# -# # return users data from session_info -# @user.get("/") -# def profile_data( -# session_info=Depends(read_authorization_header), -# agent: PEPDatabaseAgent = Depends(get_db), -# ): -# """ -# Return the user's profile data. -# """ -# if session_info is None: -# return RedirectResponse(url="/auth/login") -# else: -# peps = agent.namespace.get( -# namespace=session_info["login"], admin=session_info["login"] -# ) -# return JSONResponse( -# content={ -# "session_info": session_info, -# "peps": [pep.dict() for pep in peps.projects], -# } -# ) -# -# -# @user.get("/data") -# def profile_data2( -# request: Request, -# session_info=Depends(read_authorization_header), -# agent: PEPDatabaseAgent = Depends(get_db), -# ): -# """ -# Return the user's profile data. -# """ -# if session_info is None: -# return RedirectResponse(url="/auth/login") -# else: -# peps = agent.namespace.get( -# namespace=session_info["login"], admin=session_info["login"] -# ) -# return { -# "request": request, -# "session_info": session_info, -# "python_version": python_version(), -# "pephub_version": pephub_version, -# "logged_in": session_info is not None, -# "peps": peps, -# }