Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move web and widget to the root of the package #374

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ jobs:
run: verdi setup -n --config .github/config/profile.yaml

- name: Install Dependencies for widget
working-directory: aiida_workgraph/widget
working-directory: aiida_workgraph_widget
run: |
npm install
npm run build

- name: Install Dependencies, Start React Application
working-directory: aiida_workgraph/web/frontend
working-directory: aiida_workgraph_web/frontend
run: |
npm install
npm run build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
python -m pip install --upgrade pip
pip install build
- name: Build widget
working-directory: aiida_workgraph/widget/
working-directory: aiida_workgraph_widget/
run: |
npm install
npm run build
- name: Build web frontend package
working-directory: aiida_workgraph/web/frontend/
working-directory: aiida_workgraph_web/frontend/
run: |
npm install
npm run build
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ build:
nodejs: "20" # maybe need to be also miniconda
jobs:
post_create_environment:
- npm --prefix aiida_workgraph/widget install
- npm --prefix aiida_workgraph/widget run build
- npm --prefix aiida_workgraph_widget install
- npm --prefix aiida_workgraph_widget run build
- python -m pip install --no-cache-dir .[docs]
- python -m pip install --exists-action=w --no-cache-dir -r docs/requirements.txt
- rabbitmq-server -detached
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ which can automatically refresh on changes of the JS files. To start the backend
server please run

```console
python aiida_workgraph/web/backend/main.py
python aiida_workgraph_web/backend/main.py
```

then start the frontend server with
```console
npm --prefix aiida_workgraph/web/frontend start
npm --prefix aiida_workgraph_web/frontend start
```

The frontend server will refresh
Expand All @@ -80,7 +80,7 @@ playwright codegen
You might want to clean your cache

```console
npm --prefix aiida_workgraph/web/frontend cache clean
npm --prefix aiida_workgraph_web/frontend cache clean
```

and also clear your browsers cache or try to start new private window.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ To install the jupyter widget support you need to in addition build the JavaScri
```console
pip install .[widget]
# build widget
cd aiida_workgraph/widget/
cd aiida_workgraph_widget/
npm install
npm run build
# build web frontend
cd ../../aiida_workgraph/web/frontend/
cd ../../aiida_workgraph_web/frontend/
npm install
npm run build
```
Expand Down Expand Up @@ -105,10 +105,10 @@ pre-commit install
```

### Widget
See the [README.md](https://github.com/aiidateam/aiida-workgraph/blob/main/aiida_workgraph/widget/README.md)
See the [README.md](https://github.com/aiidateam/aiida-workgraph/blob/main/aiida_workgraph_widget/README.md)

### Web app
See the [README.md](https://github.com/aiidateam/aiida-workgraph/blob/main/aiida_workgraph/web/README.md)
See the [README.md](https://github.com/aiidateam/aiida-workgraph/blob/main/aiida_workgraph_web/README.md)


## License
Expand Down
2 changes: 1 addition & 1 deletion aiida_workgraph/cli/cmd_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def start():
backend_process = subprocess.Popen(
[
"uvicorn",
"aiida_workgraph.web.backend.app.api:app",
"aiida_workgraph_web.backend.app.api:app",
"--reload",
"--port",
"8000",
Expand Down
2 changes: 1 addition & 1 deletion aiida_workgraph/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from aiida_workgraph.sockets import socket_pool

if USE_WIDGET:
from aiida_workgraph.widget import NodeGraphWidget
from aiida_workgraph_widget import NodeGraphWidget
from aiida_workgraph.collection import (
WorkGraphPropertyCollection,
WorkGraphInputSocketCollection,
Expand Down
2 changes: 1 addition & 1 deletion aiida_workgraph/workgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from typing import Any, Dict, List, Optional, Union

if USE_WIDGET:
from aiida_workgraph.widget import NodeGraphWidget
from aiida_workgraph_widget import NodeGraphWidget


class WorkGraph(node_graph.NodeGraph):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from aiida.manage import manager
from aiida_workgraph.web.backend.app.daemon import router as daemon_router
from aiida_workgraph.web.backend.app.workgraph import router as workgraph_router
from aiida_workgraph.web.backend.app.datanode import router as datanode_router
from aiida_workgraph_web.backend.app.daemon import router as daemon_router
from aiida_workgraph_web.backend.app.workgraph import router as workgraph_router
from aiida_workgraph_web.backend.app.datanode import router as datanode_router
from fastapi.staticfiles import StaticFiles
from pathlib import Path
import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def read_datanode_data(
labelSearch: str = Query(None),
) -> List[Dict[str, Any]]:
from aiida.orm import QueryBuilder, Data
from aiida_workgraph.web.backend.app.utils import time_ago
from aiida_workgraph_web.backend.app.utils import time_ago

try:
builder = QueryBuilder()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/source/development/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ To contribute to this repository, please enable pre-commit to ensure that the co

Widget
----------------
See the `README.md <https://github.com/superstar54/aiida-workgraph/blob/main/aiida_workgraph/widget/README.md>`_.
See the `README.md <https://github.com/superstar54/aiida-workgraph/blob/main/aiida_workgraph_widget/README.md>`_.

Web app
----------------
See the `README.md <https://github.com/superstar54/aiida-workgraph/blob/main/aiida_workgraph/web/README.md>`_.
See the `README.md <https://github.com/superstar54/aiida-workgraph/blob/main/aiida_workgraph_web/README.md>`_.
4 changes: 2 additions & 2 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ To install the jupyter widget support you need to in addition build the JavaScri
$ cd aiida-workgraph
$ pip install -e .
$ # build widget
$ cd aiida_workgraph/widget/
$ cd aiida_workgraph_widget/
$ npm install
$ npm run build
$ # build web frontend
$ cd ../../aiida_workgraph/web/frontend/
$ cd ../../aiida_workgraph_web/frontend/
$ npm install
$ npm run build

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ workgraph = "aiida_workgraph.cli.cmd_workgraph:workgraph"
exclude = [
"docs/",
"tests/",
"aiida_workgraph/web/frontend/node_modules/",
"aiida_workgraph/widget/node_modules/",
"aiida_workgraph_web/frontend/node_modules/",
"aiida_workgraph_widget/node_modules/",
]


Expand Down
2 changes: 1 addition & 1 deletion tests/web/backend/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ def set_backend_server_settings(aiida_profile):

@pytest.fixture(scope="module")
def client(set_backend_server_settings):
from aiida_workgraph.web.backend.app.api import app
from aiida_workgraph_web.backend.app.api import app

return TestClient(app)
2 changes: 1 addition & 1 deletion tests/web/frontend/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def ran_wg_calcfunction(
@pytest.fixture(scope="module")
def uvicorn_configuration():
return {
"app": "aiida_workgraph.web.backend.app.api:app",
"app": "aiida_workgraph_web.backend.app.api:app",
"host": "0.0.0.0",
"port": 8000,
"log_level": "info",
Expand Down
Loading