Skip to content

Commit

Permalink
chore(weave): Move old build files #2551
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong authored Oct 2, 2024
1 parent ec516f4 commit de83436
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 34 deletions.
15 changes: 0 additions & 15 deletions MANIFEST.in

This file was deleted.

6 changes: 6 additions & 0 deletions weave_query/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include requirements.*
include wb_schema.gql
graft weave_query
global-exclude */__pycache__/*
global-exclude *.pyc
global-exclude */cassettes/*
8 changes: 4 additions & 4 deletions build_dist.py → weave_query/build_dist.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
with open("MANIFEST.in") as f:
for line in f.readlines():
if line.startswith("graft"):
known_dirs.add(line.split(" ")[1].strip().replace("weave/", ""))
known_dirs.add(line.split(" ")[1].strip().replace("weave_query/", ""))

bad_dirs = set()
for name in os.listdir("./weave"):
if os.path.isfile(os.path.join("./weave", name)):
for name in os.listdir("./weave_query"):
if os.path.isfile(os.path.join("./weave_query", name)):
continue
if name in ignored_dirs:
continue
Expand All @@ -43,7 +43,7 @@
)

if os.getenv("WEAVE_SKIP_BUILD") == None:
subprocess.run(["bash", "weave_query/weave_query/frontend/build.sh"], check=True)
subprocess.run(["bash", "weave_query/frontend/build.sh"], check=True)
else:
print("!!! Skipping frontend build !!!")

Expand Down
16 changes: 4 additions & 12 deletions setup.py → weave_query/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

ROOT = Path(__file__).resolve().parent
SKIP_BUILD = os.environ.get("WEAVE_SKIP_BUILD", False)
IS_BUILT = (
ROOT / "weave_query" / "weave_query" / "frontend" / "assets"
).is_dir() or SKIP_BUILD
IS_BUILT = (ROOT / "weave_query" / "frontend" / "assets").is_dir() or SKIP_BUILD
FORCE_BUILD = os.environ.get("WEAVE_FORCE_BUILD", False)


Expand All @@ -42,7 +40,7 @@ def check_build_deps() -> bool:
def build_frontend() -> None:
check_build_deps()
try:
build_script = str(Path("weave_query", "weave_query", "frontend", "build.sh"))
build_script = str(Path("weave_query", "frontend", "build.sh"))
subprocess.run(["bash", build_script], cwd=ROOT)
except OSError:
raise RuntimeError("Failed to build frontend.")
Expand Down Expand Up @@ -73,16 +71,10 @@ def download_and_extract_tarball(


def download_frontend() -> None:
sha = (
open(ROOT / "weave_query" / "weave_query" / "frontend" / "sha1.txt")
.read()
.strip()
)
sha = open(ROOT / "weave_query" / "frontend" / "sha1.txt").read().strip()
url = f"https://storage.googleapis.com/wandb-cdn-prod/weave/{sha}.tar.gz"
try:
download_and_extract_tarball(
url, extract_path=ROOT / "weave_query" / "weave_query"
)
download_and_extract_tarball(url, extract_path=ROOT / "weave_query")
except HTTPError:
print(f"Warning: Failed to download frontend for sha {sha}")

Expand Down
6 changes: 3 additions & 3 deletions weave_query/weave_query/frontend/build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit de83436

Please sign in to comment.