Skip to content

Commit

Permalink
fixed frontend build dist missing
Browse files Browse the repository at this point in the history
  • Loading branch information
visualDust committed Nov 27, 2023
1 parent 7cfd011 commit a998b7b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.pytest_cache
__pycache__/
dist/
frontend_dist/
poetry.lock
test/optional
build_and_reinstall_wheel.cmd
Expand Down
12 changes: 3 additions & 9 deletions neetbox/daemon/server/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@
werkzeug_log = logging.getLogger("werkzeug")
werkzeug_log.setLevel(logging.ERROR) # disable flask http call logs

if __name__ == "__main__":
import ultraimport # if run server solely, sssssssuse relative import, do not trigger neetbox init

_protocol = ultraimport("__dir__/../_protocol.py")
from _protocol import *
else:
from neetbox.daemon._protocol import *

import setproctitle
from flask import abort, json, request, send_from_directory
from websocket_server import WebsocketServer

from neetbox.daemon._protocol import *

__PROC_NAME = "NEETBOX SERVER"
setproctitle.setproctitle(__PROC_NAME)

Expand Down Expand Up @@ -285,7 +279,7 @@ def send_to_client_of_name(name, message):
# ws_send(data, to=target_sid)
# return "ok"

front_end_dist_path = os.path.join(os.path.dirname(__file__), "../../frontend/dist")
front_end_dist_path = os.path.join(os.path.dirname(__file__), "../../frontend_dist")

@app.route("/")
def static_serve_root():
Expand Down
3 changes: 3 additions & 0 deletions neetbox/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ export default defineConfig({
rewrite: (path) => path.replace(/^\/ws\//, ''),
}
}
},
build: {
outDir: "../frontend_dist"
}
})
14 changes: 5 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "neetbox"
version = "0.2.0"
version = "0.2.1"
description = "NEETBox contains useless CV code snippets."
license = "MIT"
authors = ["VisualDust <[email protected]>"]
Expand All @@ -27,7 +27,6 @@ classifiers = [
]

exclude = ["neetbox/frontend"]
include = ["neetbox/frontend/dist"]

# [[tool.poetry.source]]
# name = "pypi"
Expand All @@ -37,25 +36,22 @@ include = ["neetbox/frontend/dist"]
[tool.poetry.dependencies]
python = ">=3.9,<3.13"
toml = ">0.10"
injector = ">=0.20"
setproctitle = ">=1.0"
rich = ">=13"
numpy = "^1.26.0"
pillow = "^10.0.1"
pre-commit = ">=3.4.0"
click = "^8.1.7"
pytest = "^7.4.3"
pyfiglet = "^1.0.2"
httpx = "^0.24.0"
flask = "^2.2.3"
websocket-client = "^1.6.4"
websocket-server = "^0.6.4"
gputil = "^1.4.0"
psutil = "^5.9.6"

[tool.poetry.group.dev.dependencies]
pytest = "^7.0.0"
pytest = "^7.4.3"
black = "^23.9.1"
isort = "^5.11.5"
pre-commit = "^3"
pre-commit = ">=3.4.0"
apiflask = "^2.0.2"
ultraimport = "^0.0.7"

Expand Down

0 comments on commit a998b7b

Please sign in to comment.