From 1287c9d89e1ce7bdb6b90d7abec7d3fa2d1480d1 Mon Sep 17 00:00:00 2001 From: AngZhou Date: Tue, 7 Jan 2025 12:41:26 +0800 Subject: [PATCH] bazel build zip success. --- .gitignore | 5 +++++ BUILD | 7 ++----- WORKSPACE | 20 ++++++++++++++++---- cli/requirements.txt | 2 +- language/python/extractor/BUILD | 9 ++++----- language/python/extractor/requirements.txt | 2 +- 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 81174ae3..2c393632 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,8 @@ bazel-bin bazel-CodeFuse-Query bazel-out bazel-testlogs + +__pycache__/ +*.pyc +*.pyo +*.pyd diff --git a/BUILD b/BUILD index 9200300e..6adf23ff 100644 --- a/BUILD +++ b/BUILD @@ -236,7 +236,7 @@ pkg_files( pkg_files( name = "coref-python-src-extractor-pkg", srcs = [ - "//language/python/extractor:test1", + "//language/python/extractor:coref-python-extractor-bin", ], attributes = pkg_attributes( mode = "0755", @@ -507,10 +507,7 @@ coref_lib_script_pkgs = [ ":coref-properties-lib-script-pkg", ":coref-sql-lib-script-pkg", # ":coref-arkts-lib-script-pkg", -] + select({ - ":custom_build": [], - "//conditions:default": [":coref-swift-lib-script-pkg"], -}) +] coref_libscript_languages = [ "java", diff --git a/WORKSPACE b/WORKSPACE index 2eed2379..f2acc2b2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -230,28 +230,40 @@ http_archive( name = "osx_godel_0.3", build_file = "godel.BUILD", sha256 = "1e7e0151f1acd1656f4079b7b16dfa4e5da607a1239149a88e9df3b543b23c30", - urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/osx-godel/godel-multipleinput-20221115.tar.gz"], + urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/osx-godel/godel-multipleinput-20221115.tar.gz", + "https://github.com/codefuse-ai/CodeFuse-Query/releases/download/godel_0.3_artifacts/godel-0.3.osx.multipleinput-20221115.tar.gz", + ], ) http_archive( name = "linux_godel_0.3", build_file = "godel.BUILD", sha256 = "4dbc04677b9c785a00c127228368919ba6cee2a1f160e83e497d44fb4820dcd3", - urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/linux-godel/godel-multipleinput-20221115.tar.gz"], + urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/linux-godel/godel-multipleinput-20221115.tar.gz", + "https://github.com/codefuse-ai/CodeFuse-Query/releases/download/godel_0.3_artifacts/godel-0.3.linux.multipleinput-20221115.tar.gz", + ], ) http_archive( name = "osx_godel_script", build_file = "godel.BUILD", sha256 = "4c4189320523ca63d9fb50e37aa0bcbd452109011a8d669d878b91492168e4e0", - urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/godel-script/osx/godel-script-osx-2ac5184520240812.tar.gz"], + urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/godel-script/osx/godel-script-osx-2ac5184520240812.tar.gz", + "https://github.com/codefuse-ai/CodeFuse-Query/releases/download/godel_0.3_artifacts/godel-script-osx-2ac5184520240812.tar.gz", + ], ) http_archive( name = "linux_godel_script", build_file = "godel.BUILD", sha256 = "ac7c0d62b02cb3d7c673dac0c69079e347f727232a56053402ebbab655fd5649", - urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/godel-script/linux/godel-script-linux-2ac5184520240812.tar.gz"], + urls = [ + "https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/godel-script/linux/godel-script-linux-2ac5184520240812.tar.gz", + "https://github.com/codefuse-ai/CodeFuse-Query/releases/download/godel_0.3_artifacts/godel-script-linux-2ac5184520240812.tar.gz", + ], ) # Setting up for bazel go dependency diff --git a/cli/requirements.txt b/cli/requirements.txt index 47bde349..5815679f 100644 --- a/cli/requirements.txt +++ b/cli/requirements.txt @@ -1,3 +1,3 @@ psutil==5.9.6 -pyinstaller==6.3.0 +pyinstaller==6.11.1 chardet==5.2.0 \ No newline at end of file diff --git a/language/python/extractor/BUILD b/language/python/extractor/BUILD index 6c440d38..0f5fc434 100644 --- a/language/python/extractor/BUILD +++ b/language/python/extractor/BUILD @@ -40,7 +40,7 @@ load("@rules_python//python:defs.bzl", "py_library") #) py_library( - name = "test", + name = "coref-python-extractor-src", srcs = glob( ["src/**/*.py"], exclude = ["**/tests/**"], @@ -61,16 +61,15 @@ filegroup( ) genrule( - name = "test1", + name = "coref-python-extractor-bin", srcs = [ "//language/python/extractor:install_source", - ":test", + ":coref-python-extractor-src", ], outs = ["coref-python-src-extractor"], cmd = """ chmod -R 755 $$(dirname $(PYTHON3))/../lib/python3.10/site-packages - $(PYTHON3) -m pip install pyinstaller - $(PYTHON3) -m pip install sqlalchemy + $(PYTHON3) -m pip install -r language/python/extractor/requirements.txt cp language/python/extractor/src/resources/hook-_tkinter.py $$(dirname $(PYTHON3))/../lib/python3.10/site-packages/PyInstaller/hooks/hook-_tkinter.py $(PYTHON3) $(locations //language/python/extractor:install_source) cp language/python/extractor/src/dist/coref-python-src-extractor $(RULEDIR) diff --git a/language/python/extractor/requirements.txt b/language/python/extractor/requirements.txt index fe8c65a9..f3bba149 100644 --- a/language/python/extractor/requirements.txt +++ b/language/python/extractor/requirements.txt @@ -2,4 +2,4 @@ SQLAlchemy~=1.4.32 tqdm~=4.64.0 astor~=0.8.1 -pyinstaller~=5.3 \ No newline at end of file +pyinstaller==6.11.1 \ No newline at end of file