This is an automated email from the ASF dual-hosted git repository.

zilto pushed a commit to branch feat/hamilton-core
in repository https://gitbox.apache.org/repos/asf/hamilton.git


The following commit(s) were added to refs/heads/feat/hamilton-core by this 
push:
     new 6d4fbfaa added CI workflow to test hamilton-core
6d4fbfaa is described below

commit 6d4fbfaa247a33dc2ac81dab5ca3b8ecf6d48982
Author: zilto <[email protected]>
AuthorDate: Fri Sep 5 21:14:26 2025 -0400

    added CI workflow to test hamilton-core
---
 .github/workflows/hamilton-core-main.yml | 48 ++++++++++++++++++++++++++++++++
 hamilton-core/setup.py                   | 24 ++++++++++++----
 2 files changed, 66 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/hamilton-core-main.yml 
b/.github/workflows/hamilton-core-main.yml
new file mode 100644
index 00000000..f26ec478
--- /dev/null
+++ b/.github/workflows/hamilton-core-main.yml
@@ -0,0 +1,48 @@
+name: Unit tests (hamilton-core)
+
+on:
+  workflow_dispatch:
+
+  pull_request:
+    branches:
+        - main
+    paths:
+        - '.github/**'
+        - 'hamilton/**'
+        - 'tests/**'
+        - 'pyproject.toml'
+
+jobs:
+  test:
+    name: "Unit Tests (hamilton-core)"
+    runs-on: ubuntu-latest
+    env:
+      UV_PRERELEASE: "allow"
+      HAMILTON_TELEMETRY_ENABLED: false
+
+    steps:
+        - name: Install Graphviz on Linux
+          if: runner.os == 'Linux'
+          run: sudo apt-get update && sudo apt-get install --yes 
--no-install-recommends graphviz
+
+        - name: Checkout repository
+          uses: actions/checkout@v4
+
+        - name: Install uv and set the python version
+          uses: astral-sh/setup-uv@v6
+          with:
+            python-version: "3.12"  # most popular Python version
+            enable-cache: true
+            cache-dependency-glob: "uv.lock"
+            activate-environment: true
+
+        - name: Install dependencies
+          run: |
+            uv venv
+            . .venv/bin/activate
+            uv pip install ./hamilton-core[core-tests]
+
+        # NOTE `test_caching.py` is the older caching mechanism
+        - name: Test hamilton main package
+          run: |
+            uv run pytest tests/ --ignore tests/integrations --ignore 
tests/plugins --ignore tests/test_caching.py
diff --git a/hamilton-core/setup.py b/hamilton-core/setup.py
index 0a4dfa05..d51a042a 100644
--- a/hamilton-core/setup.py
+++ b/hamilton-core/setup.py
@@ -1,19 +1,20 @@
 
-import tomllib
+import os
 import pathlib
 import re
-import os
 import shutil
 import sys
+
+import tomllib
 from setuptools import setup
 
-# ensure the right current working directory
 os.chdir(os.path.abspath(os.path.dirname(__file__)))
 
+
 def copy_hamilton_library():
     setup_dir = pathlib.Path(__file__).resolve().parent
-    source_dir = (setup_dir.parent / 'hamilton').resolve()
-    dest_dir = (setup_dir / 'hamilton' / '_hamilton').resolve()
+    source_dir = (setup_dir.parent / "hamilton").resolve()
+    dest_dir = (setup_dir / "hamilton" / "_hamilton").resolve()
 
     # Safety checks
     if not source_dir.is_dir():
@@ -37,7 +38,7 @@ def copy_hamilton_library():
 def get_version():
     version_path = pathlib.Path(__file__).parent / "hamilton" / "_hamilton" / 
"version.py"
     content = version_path.read_text()
-    match = re.search(r'^VERSION\s*=\s*\(([^)]+)\)', content, re.MULTILINE)
+    match = re.search(r"^VERSION\s*=\s*\(([^)]+)\)", content, re.MULTILINE)
     if match:
         version_tuple_str = match.group(1)  # "1, 88, 0"
         # Parse tuple string into list of integers
@@ -61,8 +62,19 @@ install_requires = list(
 extras_require = {
     **project.get("optional-dependencies", {}),
     **{"visualization": ["graphviz"]},  # drop networkx
+    **{
+        "core-tests": [  # dependencies required to run unit tests; used in CI
+            "pytest",
+            "pytest-asyncio",
+            "pandas",
+            "typer",
+            "networkx",
+            "graphviz",
+        ]
+    }
 }
 
+
 setup(
     name="sf-hamilton-core",
     version=get_version(),

Reply via email to