Skip to content

Commit 5292170

Browse files
doombeakerwjymtgOf-qinhailinjm8780860
authored
feat: pack BizyAir as bizyair and bizyui python packages (#356)
* notif funcs * fix type parsing * read all by type * fix typo * [feat]release & notification * [feat]change apikey can't reload unread count bug * [feat]release * fix * format * fix * remove submodule bizyair_frontend * set api key left bug * resolve circular import * rename menu-box to bizyair-menu-box * rename bizyair.bizyair to bizyair.core * remove useless files * remove showcase file * almost ok * update workflow about versioning * refine increment version * refine * upload pip almost ok * use product pypi url * get version info from pip html content * update version and remove useless js * reanme backend/bizyair to backend/bizyengine * Update README.md * update version * fix typos --------- Co-authored-by: wjymtg <wangjiuyang@siliconflow.cn> Co-authored-by: of-HaiQin <5372604@qq.com> Co-authored-by: lin8780860@163.com <lin8780860@163.com>
1 parent 0dfb3ff commit 5292170

115 files changed

Lines changed: 489 additions & 458 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ venv/
77
*.log
88
api_key.ini
99
.DS_Store
10+
*.egg-info
11+
dist/
12+
js/

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "bizyair_frontend"]
2-
path = bizyair_frontend
3-
url = https://github.com/siliconflow/bizyair_frontend.git

__init__.py

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,3 @@
1-
import os
2-
import sys
3-
4-
current_path = os.path.abspath(os.path.dirname(__file__))
5-
src_path = os.path.join(current_path, "src")
6-
if os.path.isdir(src_path):
7-
sys.path.insert(0, src_path)
8-
9-
from bizyair import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
1+
from bizyengine import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
102

113
WEB_DIRECTORY = "./js"
12-
13-
from . import (
14-
auth,
15-
bizyair_extras,
16-
llm,
17-
mzkolors,
18-
nodes,
19-
nodes_controlnet_aux,
20-
nodes_controlnet_union_sdxl,
21-
segment_anything,
22-
showcase,
23-
supernode,
24-
)
25-
26-
27-
def update_mappings(module):
28-
NODE_CLASS_MAPPINGS.update(**module.NODE_CLASS_MAPPINGS)
29-
NODE_DISPLAY_NAME_MAPPINGS.update(**module.NODE_DISPLAY_NAME_MAPPINGS)
30-
31-
32-
update_mappings(auth)
33-
update_mappings(supernode)
34-
update_mappings(llm)
35-
update_mappings(nodes_controlnet_aux)
36-
update_mappings(nodes_controlnet_union_sdxl)
37-
update_mappings(mzkolors)
38-
update_mappings(segment_anything)
39-
40-
try:
41-
import bizy_server
42-
except Exception as e:
43-
print("\n\n\033[91m[BizyAir]\033[0m Fail to import 'bizy_server':" f" {e}\n\n")

backend/MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include bizyengine/core/configs/*.json
2+
include bizyengine/core/configs/*.yaml
3+
include bizyengine/version.txt

backend/README.md

Lines changed: 6 additions & 0 deletions

backend/bizyengine/__init__.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
2+
3+
from bizyengine.core import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
4+
5+
WEB_DIRECTORY = "./js"
6+
import bizyengine.bizyair_extras
7+
from bizyengine.misc import (
8+
auth,
9+
llm,
10+
mzkolors,
11+
nodes,
12+
nodes_controlnet_aux,
13+
nodes_controlnet_union_sdxl,
14+
segment_anything,
15+
supernode,
16+
)
17+
18+
19+
def update_mappings(module):
20+
NODE_CLASS_MAPPINGS.update(**module.NODE_CLASS_MAPPINGS)
21+
NODE_DISPLAY_NAME_MAPPINGS.update(**module.NODE_DISPLAY_NAME_MAPPINGS)
22+
23+
24+
update_mappings(auth)
25+
update_mappings(supernode)
26+
update_mappings(llm)
27+
update_mappings(nodes_controlnet_aux)
28+
update_mappings(nodes_controlnet_union_sdxl)
29+
update_mappings(mzkolors)
30+
update_mappings(segment_anything)
31+
32+
try:
33+
import bizyengine.bizy_server as bizy_server
34+
except Exception as e:
35+
print("\n\n\033[91m[BizyAir]\033[0m Fail to import 'bizy_server':" f" {e}\n\n")
File renamed without changes.

src/bizy_server/api_client.py renamed to backend/bizyengine/bizy_server/api_client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
import urllib
33

44
import aiohttp
5-
6-
import bizyair
7-
import bizyair.common
8-
from bizyair.common.env_var import BIZYAIR_PRODUCTION_TEST, BIZYAIR_SERVER_ADDRESS
5+
import bizyengine.core as core
6+
from bizyengine.core.common import get_api_key
7+
from bizyengine.core.common.env_var import (
8+
BIZYAIR_PRODUCTION_TEST,
9+
BIZYAIR_SERVER_ADDRESS,
10+
)
911

1012
from .errno import ErrorNo, errnos
1113
from .error_handler import ErrorHandler
1214
from .utils import is_string_valid
1315

14-
with open(
15-
os.path.join(os.path.dirname(__file__), "..", "..", "version.txt"), "r"
16-
) as file:
16+
with open(os.path.join(os.path.dirname(__file__), "..", "version.txt"), "r") as file:
1717
CLIENT_VERSION = file.read()
1818

1919

@@ -27,7 +27,7 @@ async def get_session(self):
2727

2828
def auth_header(self):
2929
try:
30-
api_key = bizyair.common.get_api_key()
30+
api_key = get_api_key()
3131
auth = f"Bearer {api_key}"
3232
headers = {
3333
"accept": "application/json",
@@ -475,13 +475,13 @@ def callback(ret: dict):
475475
outputs = [
476476
x["label_path"] for x in ret["data"]["files"] if x["label_path"]
477477
]
478-
outputs = bizyair.path_utils.filter_files_extensions(
478+
outputs = core.path_utils.filter_files_extensions(
479479
outputs,
480-
extensions=bizyair.path_utils.path_manager.supported_pt_extensions,
480+
extensions=core.path_utils.path_manager.supported_pt_extensions,
481481
)
482482
return outputs, None
483483

484-
ret = await bizyair.common.client.async_send_request(
484+
ret = await core.common.client.async_send_request(
485485
method="GET", url=server_url, params=payload, callback=callback
486486
)
487487
return ret[0], ret[1]
File renamed without changes.

0 commit comments

Comments
 (0)