From e986304592d66482d3ff5b7bf832c3b4b88c1c69 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 23 Jan 2022 20:17:08 +1000 Subject: [PATCH] replace some bazel-bin references in our scripts + fix scripts/mypy-watch, and make it only listen to change events --- qt/dmypy.py | 10 +++++----- scripts/build | 2 +- scripts/build.bat | 2 +- scripts/mypy-watch | 2 +- scripts/svelte-check | 2 +- scripts/ts-run | 2 +- ts/tsconfig.json | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/qt/dmypy.py b/qt/dmypy.py index 04940c7ec..47d266272 100755 --- a/qt/dmypy.py +++ b/qt/dmypy.py @@ -13,8 +13,8 @@ import time from pathlib import Path workspace = Path(os.environ["BUILD_WORKSPACE_DIRECTORY"]) -binroot = workspace / "bazel-bin" -dmypy_bin = binroot / "external/py_deps_pypi__mypy/rules_python_wheel_entry_point_dmypy" +binroot = workspace / "../bazel/anki/bin" +dmypy_bin = binroot / "external/py_deps_mypy/rules_python_wheel_entry_point_dmypy" if sys.platform.startswith("win32"): binext = ".exe" @@ -30,13 +30,13 @@ if subprocess.run( "--", "--config-file", "qt/mypy.ini", - "bazel-bin/qt/dmypy.runfiles/ankidesktop/pylib/anki", - "bazel-bin/qt/dmypy.runfiles/ankidesktop/qt/aqt", + "../bazel/anki/bin/qt/dmypy.runfiles/ankidesktop/pylib/anki", + "../bazel/anki/bin/qt/dmypy.runfiles/ankidesktop/qt/aqt", "--python-executable", os.path.abspath("python/stubs/extendsitepkgs"), ], env={ - "MYPYPATH": "bazel-bin/qt/dmypy.runfiles/pyqt6", + "MYPYPATH": "../bazel/anki/bin/qt/dmypy.runfiles/pyqt6", "EXTRA_SITE_PACKAGES": os.path.abspath(os.getenv("EXTRA_SITE_PACKAGES")), }, cwd=workspace, diff --git a/scripts/build b/scripts/build index ae2b2f45b..2ba907ea2 100755 --- a/scripts/build +++ b/scripts/build @@ -9,4 +9,4 @@ test -e WORKSPACE || ( rm -rf bazel-dist bazel build --config opt dist -tar xvf bazel-bin/dist.tar +tar xvf ../bazel/anki/bin/dist.tar diff --git a/scripts/build.bat b/scripts/build.bat index 0aa80294f..ca43defa9 100755 --- a/scripts/build.bat +++ b/scripts/build.bat @@ -9,4 +9,4 @@ rd /s /q bazel-dist set BUILDARGS=-k -c opt dist --color=yes call .\bazel build %BUILDARGS% || exit /b 1 -tar xvf bazel-bin\dist.tar || exit /b 1 +tar xvf ..\bazel\anki\bin\dist.tar || exit /b 1 diff --git a/scripts/mypy-watch b/scripts/mypy-watch index f99018f75..7aec24666 100755 --- a/scripts/mypy-watch +++ b/scripts/mypy-watch @@ -8,4 +8,4 @@ cmd='printf \\033c\\n; bazel run qt:dmypy' sh -c "$cmd" # then monitor for changes -fswatch -r -o pylib qt | xargs -n1 -I{} sh -c "$cmd" \ No newline at end of file +fswatch -r -o --event Updated pylib qt | xargs -n1 -I{} sh -c "$cmd" \ No newline at end of file diff --git a/scripts/svelte-check b/scripts/svelte-check index a84d820e6..cc43eb962 100755 --- a/scripts/svelte-check +++ b/scripts/svelte-check @@ -1,5 +1,5 @@ #!/bin/bash -SASS_PATH=ts/sass:$(pwd)/bazel-bin/ts/sass \ +SASS_PATH=ts/sass:$(pwd)/../bazel/anki/bin/ts/sass \ node_modules/.bin/svelte-check \ --workspace ts diff --git a/scripts/ts-run b/scripts/ts-run index dbcfbe4fc..69a7efc51 100755 --- a/scripts/ts-run +++ b/scripts/ts-run @@ -6,6 +6,6 @@ # The pages can be accessed by, eg surfing to # http://localhost:40000/_anki/pages/deckconfig.html -ANKI_DATA_FOLDER=$(pwd)/bazel-bin/qt/aqt \ +ANKI_DATA_FOLDER=$(pwd)/../bazel/anki/bin/qt/aqt \ QTWEBENGINE_REMOTE_DEBUGGING=8080 \ ANKI_API_PORT=40000 ANKIDEV=1 ./run $* diff --git a/ts/tsconfig.json b/ts/tsconfig.json index b1e3f4f0d..b477c4e80 100644 --- a/ts/tsconfig.json +++ b/ts/tsconfig.json @@ -36,7 +36,7 @@ "rootDirs": [ ".", // for VS code - "../bazel-bin/ts" + "../../bazel/anki/bin/ts" ], "baseUrl": ".", "paths": {},