From ff2119e6bf8f756159e73c4e97c2590c497fecb4 Mon Sep 17 00:00:00 2001 From: mikebender Date: Thu, 4 Jul 2024 10:36:51 -0400 Subject: [PATCH] build: Clean the build directory before building the wheel - When rebuilding the wheel, it had stale files for the _js files, which was confusing and annoying - Clean the build directory so it doesn't have stale files - Remove the `package_data` flag - it's already captured by default with the `include_package_data` option: https://setuptools.pypa.io/en/latest/userguide/datafiles.html#include-package-data - Still need to run `npm run build` between builds --- plugins/ui/setup.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/ui/setup.py b/plugins/ui/setup.py index 29b112d5b..d2d034634 100644 --- a/plugins/ui/setup.py +++ b/plugins/ui/setup.py @@ -1,10 +1,17 @@ from setuptools import setup import os +import shutil from deephaven.plugin.packaging import package_js js_dir = "src/js/" dest_dir = os.path.join("src/deephaven/ui/_js") +# remove the build directory to ensure that the package is built from the latest js files +try: + shutil.rmtree("build") +except FileNotFoundError: + pass + package_js(js_dir, dest_dir) -setup(package_data={"deephaven.ui._js": ["**"]}) +setup()