From 28758c5e8f21777fbb8c867377aca6617d86208d Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Tue, 2 Jan 2024 12:35:48 -0500 Subject: [PATCH] added backend forking --- pephub/routers/api/v1/project.py | 16 ++++++++-------- requirements/requirements-all.txt | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pephub/routers/api/v1/project.py b/pephub/routers/api/v1/project.py index 5440df1a..c9b5a66b 100644 --- a/pephub/routers/api/v1/project.py +++ b/pephub/routers/api/v1/project.py @@ -542,7 +542,6 @@ async def zip_pep_for_download(proj: peppy.Project = Depends(get_project)): ) async def fork_pep_to_namespace( fork_request: ForkRequest, - proj: peppy.Project = Depends(get_project), proj_annotation: AnnotationModel = Depends(get_project_annotation), agent: PEPDatabaseAgent = Depends(get_db), ): @@ -556,14 +555,15 @@ async def fork_pep_to_namespace( fork_name = fork_request.fork_name fork_tag = fork_request.fork_tag try: - agent.project.create( - project=proj, - namespace=fork_to, - name=fork_name, - tag=fork_tag or DEFAULT_TAG, - description=proj_annotation.description, - pep_schema=proj_annotation.pep_schema, + agent.project.fork( + original_namespace=proj_annotation.namespace, + original_name=proj_annotation.name, + original_tag=proj_annotation.tag, + fork_namespace=fork_to, + fork_name=fork_name, + fork_tag=fork_tag, ) + except ProjectUniqueNameError as _: raise HTTPException( status_code=400, diff --git a/requirements/requirements-all.txt b/requirements/requirements-all.txt index 79c61f76..2c9dfa67 100644 --- a/requirements/requirements-all.txt +++ b/requirements/requirements-all.txt @@ -8,7 +8,7 @@ python-multipart>=0.0.5 tqdm uvicorn python-dotenv -pepdbagent @ git+https://github.com/pepkit/pepdbagent@dev#egg=pepdbagent +pepdbagent @ git+https://github.com/pepkit/pepdbagent@fork#egg=pepdbagent peppy>=0.40.0a5 qdrant-client requests