Dev-iL commented on code in PR #1488:
URL: https://github.com/apache/hamilton/pull/1488#discussion_r2851141900


##########
.github/workflows/hamilton-lsp.yml:
##########
@@ -33,6 +33,7 @@ jobs:
     - name: Install dependencies
       run: |
         python -m pip install --upgrade pip pytest
+        pip install -e ${{ github.workspace }}
         pip install -e .

Review Comment:
   So why not `uv pip`? Roughly,
   
   
   ```suggestion
         curl -LsSf https://astral.sh/uv/install.sh | sh
         uv pip install -e ${{ github.workspace }} -e . pytest
   ```



##########
ui/sdk/requirements.txt:
##########
@@ -5,5 +5,5 @@ jinja2 # for SDK, todo -- move out
 loguru # for init, todo -- move out
 posthog
 requests
-sf-hamilton>=1.43.0
+# sf-hamilton>=1.43.0

Review Comment:
   ```suggestion
   apache-hamilton>=1.89.0
   ```



##########
ui/backend/server/server/settings.py:
##########
@@ -147,11 +148,15 @@ def get_from_env(
 if HAMILTON_ENV == "mini":
     STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
     STATIC_URL = "/static/"
-    STATICFILES_DIRS = [
-        os.path.join(BASE_DIR, "build/static/"),
-    ]
+    # Support both Vite (assets/) and CRA (static/) build outputs
+    staticfiles_dirs = []
+    if (BASE_DIR / "build/assets/").exists():
+        staticfiles_dirs.append(str(BASE_DIR / "build/assets/"))
+    if (BASE_DIR / "build/static/").exists():
+        staticfiles_dirs.append(str(BASE_DIR / "build/static/"))
+    STATICFILES_DIRS = staticfiles_dirs
     MEDIA_URL = "/media/"
-    MEDIA_ROOT = os.path.join(BASE_DIR, "build/")
+    MEDIA_ROOT = str(BASE_DIR / "build/")

Review Comment:
   To produce consistent paths (with `/` folder separators) regardless of OS
   ```suggestion
       MEDIA_ROOT = (BASE_DIR / "build").as_posix()
   ```
   However, the above does not produce a trailing `/` - are you sure it is 
required?



##########
ui/backend/server/server/urls.py:
##########
@@ -47,9 +46,45 @@
     urlpatterns = [
         path("api/", api.api.urls),
         path("admin/", admin.site.urls),
-        re_path(r"^logo\.png$", serve, {"document_root": settings.MEDIA_ROOT, 
"path": "logo.png"}),
-        re_path(".*", TemplateView.as_view(template_name="index.html")),
-    ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
+    ]
+
+    # Serve root-level assets from build/ directory
+    build_dir = settings.BASE_DIR / "build/"

Review Comment:
   ```suggestion
       build_dir = settings.BASE_DIR / "build"
   ```
   
   Because:
   ```python
   >>> Path("a") / "b"
   PosixPath('a/b')
   >>> Path("a") / "b/"
   PosixPath('a/b')
   ```



##########
ui/backend/pyproject.toml:
##########
@@ -0,0 +1,90 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[build-system]
+requires = ["flit_core >=3.11,<4"]
+build-backend = "flit_core.buildapi"
+
+[project]
+name = "apache-hamilton-ui"
+version = "0.0.17"
+description = "Apache Hamilton UI tracking server for dataflow visualization 
and monitoring."
+requires-python = ">=3.10, <4"
+license = "Apache-2.0"
+license-files = ["LICENSE", "NOTICE", "DISCLAIMER"]
+keywords = ["hamilton", "ui", "tracking", "visualization"]
+authors = [
+    {name = "Stefan Krawczyk", email = "[email protected]"},
+    {name = "Elijah ben Izzy", email = "[email protected]"}
+]
+classifiers = [
+    "Development Status :: 5 - Production/Stable",
+    "Intended Audience :: Developers",
+    "Natural Language :: English",
+    "Programming Language :: Python :: 3",
+    "Programming Language :: Python :: 3.10",
+    "Programming Language :: Python :: 3.11",
+    "Programming Language :: Python :: 3.12",
+    "Programming Language :: Python :: 3.13",
+    "Programming Language :: Python :: 3.14",
+]
+dependencies = [
+    "aiofiles",
+    "aiohttp>=3.13.0",
+    "click",
+    "colorlog",
+    "ddtrace>=2.21.0",
+    "django>=4.2.0",
+    "django-extensions",
+    "django-ninja>=1.1.0",
+    "loguru",
+    "passlib",
+    "psycopg2-binary",
+    "pydantic>=2.0.0",
+    "requests>=2.32.0",
+    # "apache-hamilton>=1.58.0",  # TODO once we publish properly fix this.
+    "sf-hamilton>=1.58.0",

Review Comment:
   What's stopping us from doing 
   
   ```suggestion
       "apache-hamilton>=1.89.0",
   ```
   Or even just
   ```suggestion
       "apache-hamilton",
   ```



##########
ui/sdk/pyproject.toml:
##########
@@ -1,62 +1,102 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 [build-system]
-requires = ["setuptools >= 61.0.0", "wheel"]
-build-backend = "setuptools.build_meta"
+requires = ["flit_core >=3.11,<4"]
+build-backend = "flit_core.buildapi"
 
 [project]
-name = "sf-hamilton-sdk"
-description = "Hamilton SDK for reading and writing to the Hamilton backend 
APIs that support the UI."
+name = "apache-hamilton-sdk"
+version = "0.8.0"
+description = "Apache Hamilton SDK for reading and writing to the Apache 
Hamilton backend APIs that support the UI."
+readme = "README.md"
+requires-python = ">=3.10, <4"
+license = "Apache-2.0"
+license-files = ["LICENSE", "NOTICE", "DISCLAIMER"]
+keywords = ["hamilton", "dagworks", "observability"]
 authors = [
     {name = "Stefan Krawczyk", email = "[email protected]"},
     {name = "Elijah ben Izzy", email = "[email protected]"}
 ]
-readme = "README.md"
-keywords = ["hamilton", "dagworks", "observability"]
 classifiers = [
     "Development Status :: 4 - Beta",
     "Intended Audience :: Developers",
     "Natural Language :: English",
-    "License :: OSI Approved :: Apache Software License",
     "Programming Language :: Python :: 3",
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
     "Programming Language :: Python :: 3.13",
     "Programming Language :: Python :: 3.14"
 ]
-requires-python = ">=3.10, <4"
-dynamic = ["dependencies", "optional-dependencies", "version"]
+dependencies = [
+    "aiohttp",
+    "click",
+    "gitpython",
+    "jinja2",
+    "loguru",
+    "posthog",
+    "requests",
+    "apache-hamilton>=1.43.0",

Review Comment:
   Won't a build fail on this since such a low version doesn't exist?
   
   
   ```suggestion
       "apache-hamilton>=1.89.0",
   ```



##########
ui/migrate_postgres_simple.sh:
##########


Review Comment:
   See previous comment about the file name.



##########
ui/migrate_postgres.sh:
##########


Review Comment:
   I think a better name for the script is `upgrade_postgres`, since "migrate" 
has a special meaning in the context of databases (changing schemas etc, not 
upgrading the "engine"). I would expect a "migration" to consist purely of SQL 
code, but it is not the case here.



##########
.gitignore:
##########
@@ -156,3 +156,5 @@ examples/**/hamilton-env
 # hamilton default caching directory
 **/.hamilton_cache/
 .claude/settings.local.json
+*.local.*
+*.claude*

Review Comment:
   Does that ignore the `.claude` folder? If so, I don't think it is desirable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to