Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ SHORT_LICENSE\.md
\.gitignore
\.rat-excludes

# Third-party vendored code with its own license (MIT)
.*databackend\.py

# PKG-INFO (generated metadata)
PKG-INFO
2 changes: 1 addition & 1 deletion hamilton/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.

VERSION = (1, 89, 0)
VERSION = (1, 90, 0)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "apache-hamilton"
version = "1.89.0" # NOTE: keep this in sync with hamilton/version.py
version = "1.90.0" # NOTE: keep this in sync with hamilton/version.py
# TODO: flip back to dynamic once hamilton version is a string. Flit doesn't handle tuples.
# dynamic = ["version"]
description = "Apache Hamilton (incubating) is a lightweight Python library for directed acyclic graphs (DAGs) of transformations. Your DAG is **portable**; it runs anywhere Python runs, whether it's a script, notebook, Airflow pipeline, FastAPI server, etc. Your DAG is **expressive**; Apache Hamilton has extensive features to define and modify the execution of a DAG (e.g., data validation, experiment tracking, remote execution)."
Expand Down
163 changes: 82 additions & 81 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,141 +132,142 @@ uv run twine upload dist/apache_hamilton-1.90.0.tar.gz dist/apache_hamilton-1.90

If you're voting on a release, follow these steps to verify the release candidate.

## Complete Verification Workflow
## Step 1: Download the Artifacts

```bash
# Set version and RC number
export VERSION=1.90.0
export RC=0
export PACKAGE=apache-hamilton # or apache-hamilton-sdk, etc.

# 1. Download all artifacts from SVN
svn export https://dist.apache.org/repos/dist/dev/incubator/hamilton/${PACKAGE}-${VERSION}-incubating-RC${RC}/ hamilton-rc${RC}
# Derived names (dashes for tarball, underscores for wheel)
export SRC_TAR=${PACKAGE}-${VERSION}-incubating-src.tar.gz
export WHEEL_NAME=$(echo ${PACKAGE} | tr '-' '_')-${VERSION}-py3-none-any.whl
export EXTRACTED_DIR=$(echo ${PACKAGE} | tr '-' '_')-${VERSION}

# Download all artifacts from SVN
svn export https://dist.apache.org/repos/dist/dev/incubator/hamilton/${PACKAGE}/${VERSION}-RC${RC}/ hamilton-rc${RC}
cd hamilton-rc${RC}

# 2. Import KEYS file and verify GPG signatures
# Import the KEYS file
wget https://downloads.apache.org/incubator/hamilton/KEYS
gpg --import KEYS
```

# Verify sdist signature
gpg --verify ${PACKAGE}-${VERSION}-incubating.tar.gz.asc ${PACKAGE}-${VERSION}-incubating.tar.gz
## Step 2: Extract and Set Up

# Verify wheel signature (note: underscores in wheel filenames)
WHEEL_NAME=$(echo ${PACKAGE} | tr '-' '_')-${VERSION}-py3-none-any.whl
gpg --verify ${WHEEL_NAME}.asc ${WHEEL_NAME}
```bash
# Extract the source archive
tar -xzf ${SRC_TAR}
cd ${EXTRACTED_DIR}/

# 3. Verify SHA512 checksums
shasum -a 512 -c ${PACKAGE}-${VERSION}-incubating.tar.gz.sha512
shasum -a 512 -c ${WHEEL_NAME}.sha512
# Create a fresh environment and install build tools
uv venv --python 3.11 --clean
uv sync --group release

# 4. Extract the source archive and build from source
tar -xzf ${PACKAGE}-${VERSION}-incubating.tar.gz
cd ${PACKAGE}-${VERSION}-incubating/
# Download Apache RAT for license verification
curl -O https://repo1.maven.org/maven2/org/apache/rat/apache-rat/0.15/apache-rat-0.15.jar
```

## Build from Source with uv
## Step 3: Run Automated Verification

All remaining steps assume you are inside the extracted source directory
(`${PACKAGE}-${VERSION}-incubating/`) from the step above.
The verification script checks GPG signatures, SHA512 checksums, and Apache license headers in one command.
The script looks for artifacts in a `dist/` directory by default, so first copy them there:

```bash
# Create a fresh environment and install build tools
uv venv --python 3.11 --clean
uv sync --group release
# Copy artifacts into dist/ so the verification script can find them
mkdir -p dist
cp ../${SRC_TAR}* dist/
cp ../${WHEEL_NAME}* dist/

# Verify everything (signatures + checksums + license headers)
uv run python scripts/verify_apache_artifacts.py all --rat-jar apache-rat-0.15.jar
```

You can also run individual checks:

```bash
# Signatures and checksums only
uv run python scripts/verify_apache_artifacts.py signatures

# License headers only
uv run python scripts/verify_apache_artifacts.py licenses --rat-jar apache-rat-0.15.jar

# Validate wheel metadata
uv run python scripts/verify_apache_artifacts.py twine-check

# Inspect artifact contents
uv run python scripts/verify_apache_artifacts.py list-contents dist/${SRC_TAR}
uv run python scripts/verify_apache_artifacts.py list-contents dist/${WHEEL_NAME}
```

## Step 4: Build from Source

```bash
# Build the wheel from source
uv run flit build --no-use-vcs

# Install the wheel you just built
uv pip install dist/apache_hamilton-${VERSION}-py3-none-any.whl
uv pip install dist/${WHEEL_NAME}
```

## Run Tests
## Step 5: Run Tests

```bash
# Install test dependencies (uses the test dependency group from pyproject.toml)
# Install test dependencies
uv sync --group test

# Run core unit tests
uv run pytest tests/ -x -q

# Run plugin tests
uv run pytest plugin_tests/ -x -q
# Note: some plugin tests require optional dependencies (ray, spark, vaex).
# Exclude any that are not installed in your environment:
uv run pytest plugin_tests/ -x -q \
--ignore=plugin_tests/h_ray \
--ignore=plugin_tests/h_spark \
--ignore=plugin_tests/h_vaex
```

## Run Examples
## Step 6: Run Examples

The source archive includes representative examples to verify Hamilton works end-to-end. Each example may require additional dependencies.
The source archive includes representative examples to verify Hamilton works end-to-end.

### Hello World (no extra deps)
```bash
cd examples/hello_world
uv run python my_script.py
cd ../..
```
# Hello World (no extra deps)
uv run python examples/hello_world/my_script.py

### Data Quality with Pandera
```bash
uv pip install pandera
# Data Quality with Pandera (must run from its directory for CSV data file)
cd examples/data_quality/simple
uv run python run.py
cd ../../..
```

### Function Reuse
```bash
cd examples/reusing_functions
uv run python run.py
cd ../..
```
# Function Reuse
uv run python examples/reusing_functions/main.py

### Schema Validation
```bash
cd examples/schema
uv run python run.py
cd ../..
```
# Schema Validation
uv run python examples/schema/dataflow.py

### Materialization (Pandas)
```bash
uv pip install openpyxl xlsxwriter
cd examples/pandas/materialization
uv run python run.py
cd ../../..
# Materialization (Pandas)
uv run python examples/pandas/materialization/my_script.py
```

## Verification Script

For automated verification of signatures, checksums, and license compliance, use the verification script.
Run these from inside the extracted source directory (`${PACKAGE}-${VERSION}-incubating/`).

### Prerequisites

Download Apache RAT for license verification (into the extracted source directory):
## Manual Signature Verification (alternative to Step 3)

```bash
curl -O https://repo1.maven.org/maven2/org/apache/rat/apache-rat/0.15/apache-rat-0.15.jar
```

### Running Verification
If you prefer to verify signatures and checksums manually instead of using the verification script:

```bash
# Run from the extracted source directory (${PACKAGE}-${VERSION}-incubating/)
# Verify GPG signatures and SHA512 checksums
uv run python scripts/verify_apache_artifacts.py signatures

# Verify license headers (requires Apache RAT)
uv run python scripts/verify_apache_artifacts.py licenses --rat-jar apache-rat-0.15.jar

# Verify everything
uv run python scripts/verify_apache_artifacts.py all --rat-jar apache-rat-0.15.jar
# From the hamilton-rc${RC}/ directory (before extracting)

# Inspect artifact contents
uv run python scripts/verify_apache_artifacts.py list-contents dist/apache-hamilton-1.90.0-incubating.tar.gz
uv run python scripts/verify_apache_artifacts.py list-contents dist/apache_hamilton-1.90.0-py3-none-any.whl
# Verify GPG signatures
gpg --verify ${SRC_TAR}.asc ${SRC_TAR}
gpg --verify ${WHEEL_NAME}.asc ${WHEEL_NAME}

# Validate wheel metadata
uv run python scripts/verify_apache_artifacts.py twine-check
# Verify SHA512 checksums
# Note: the .sha512 files contain only the raw hash (no filename),
# so `shasum -c` won't work. Compare hashes manually instead:
echo "$(cat ${SRC_TAR}.sha512) ${SRC_TAR}" | shasum -a 512 -c -
echo "$(cat ${WHEEL_NAME}.sha512) ${WHEEL_NAME}" | shasum -a 512 -c -
```

# Local Development
Expand Down
Loading