Skip to content

Various build & release fixes#1529

Open
skrawcz wants to merge 2 commits intomainfrom
release-tooling-fixes
Open

Various build & release fixes#1529
skrawcz wants to merge 2 commits intomainfrom
release-tooling-fixes

Conversation

@skrawcz
Copy link
Copy Markdown
Contributor

@skrawcz skrawcz commented Mar 28, 2026

Once this is merged I can do a release of apache-hamilton.

Changes

  • improves docs and scripts for releasing
  • specifically: adds tests and some examples to source
  • validated things work locally and rat-jar licenses are good

How I tested this

  • runs locally
uv run python scripts/apache_release_helper.py --package hamilton 1.90.0 0 skrawcz --dry-run

================================================================================
  Apache Hamilton Release Helper - apache-hamilton
================================================================================

Checking for required tools...
Python 'build' module found.
All required tools found.
Current version in hamilton/version.py: 1.90.0

[dry-run] Skipping git tag creation: apache-hamilton-v1.90.0-incubating-RC0

================================================================================
  Building Release Artifacts
================================================================================

Creating release artifacts for apache-hamilton with 'flit build'...
Built sdist: dist/apache_hamilton-1.90.0.tar.gz                                                                              I-flit_core.sdist
Copying package file(s) from /var/folders/zr/_by5tryx5tz060zdf1l5_9jr0000gn/T/tmpw_klxwtb/apache_hamilton-1.90.0/hamilton    I-flit_core.wheel
Writing metadata files                                                                                                       I-flit_core.wheel
Writing the record of files                                                                                                  I-flit_core.wheel
Built wheel: dist/apache_hamilton-1.90.0-py3-none-any.whl                                                                    I-flit_core.wheel
Source distribution created successfully.
/Users/skrawczyk/salesforce/hamilton/scripts/apache_release_helper.py:292: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
  tar.extractall(path=tmpdir)
Found source tarball: dist/apache-hamilton-1.90.0-incubating-src.tar.gz
gpg: using "xxx" as default secret key for signing
Created GPG signature: dist/apache-hamilton-1.90.0-incubating-src.tar.gz.asc
Created SHA512 checksum: dist/apache-hamilton-1.90.0-incubating-src.tar.gz.sha512
Validating wheel with twine: dist/apache_hamilton-1.90.0-py3-none-any.whl
Checking dist/apache_hamilton-1.90.0-py3-none-any.whl: PASSED

Wheel passed twine validation.
gpg: using "xxx" as default secret key for signing
Created GPG signature: dist/apache_hamilton-1.90.0-py3-none-any.whl.asc
Created SHA512 checksum: dist/apache_hamilton-1.90.0-py3-none-any.whl.sha512

================================================================================
  [dry-run] Skipping SVN upload
================================================================================

Artifacts built successfully:
  dist/apache-hamilton-1.90.0-incubating-src.tar.gz
  dist/apache-hamilton-1.90.0-incubating-src.tar.gz.asc
  dist/apache-hamilton-1.90.0-incubating-src.tar.gz.sha512
  dist/apache_hamilton-1.90.0-py3-none-any.whl
  dist/apache_hamilton-1.90.0-py3-none-any.whl.asc
  dist/apache_hamilton-1.90.0-py3-none-any.whl.sha512

To do a real release, re-run without --dry-run.

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

- Switch from FLIT_USE_VCS=0 env var to --no-use-vcs CLI flag
  (flit 3.12.0 does not respect the env var)
- Restore twine to prerequisites check
- Restore verify_wheel_with_twine call before signing

Add release tooling: verification scripts, build fixes, and docs

- Add verify_apache_artifacts.py for GPG signature, checksum, and license verification
- Add scripts/README.md with build, release, and voter verification instructions (uv-based)
- Add .rat-excludes for Apache RAT license header checks
- Add verify_ui_build.sh with Apache license header
- Fix release helper: add verify_wheel_with_twine function, --dry-run flag,
  remove -incubating suffix from wheel (invalid per PEP 427),
  clean up original flit artifacts after creating incubating copies
- Add tests, plugin_tests, and representative examples to flit sdist includes
adds uv run to examples

Co-authored-by: Stefan Krawczyk <stefan@dagworks.io>
@skrawcz skrawcz requested a review from elijahbenizzy March 28, 2026 21:20
Copy link
Copy Markdown
Collaborator

@Dev-iL Dev-iL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with release scripts, so my comments aren't too insightful I'm afraid. I didn't go over the large file outside a brief glance.

new_tar_ball = f"dist/{package_name}-{version.lower()}-incubating-src.tar.gz"
_modify_tarball_for_apache_release(tarball_path[0], new_tar_ball, package_name)
# Remove original flit tarball (only keep the incubating copy)
os.remove(tarball_path[0])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's in position [0]? Is there a risk it's ever something else? Maybe use list.index? Same applies to wheel_file.


wheel_signed_files = sign_artifacts(wheel_file)

files_to_upload = [new_tar_ball] + new_tar_ball_singed + [wheel_file] + wheel_signed_files
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Policy on source versus distribution

Apache Hamilton is an apache-incubating project. As such, we intend to follow all Apache guidelines to
both the spirit (and when applicable) the letter.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
both the spirit (and when applicable) the letter.
both the spirit and (when applicable) the letter.

- Apache RAT jar for license checking (optional, for verification)

```bash
# Install uv (if not already installed)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Install uv (if not already installed)
# Install uv (unless already installed)


# Create a virtual environment with build dependencies
uv venv --python 3.11
uv pip install flit twine
Copy link
Copy Markdown
Collaborator

@Dev-iL Dev-iL Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps uv sync with a "build-tools" group?

uv run pytest tests/ -x -q

# Run plugin tests (requires additional dependencies)
uv pip install dask graphviz networkx pandera pydantic polars pyarrow scikit-learn
Copy link
Copy Markdown
Collaborator

@Dev-iL Dev-iL Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to include this in the testing group? If there is... Make another group called testing-plugins.


```bash
# Create a fresh environment and install build tools
uv venv --python 3.11
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a command to clean the existing venv, won't hurt to add it. (--clean ?)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have uv entry points for all of these? Or do we specifically want to avoid shortcuts in this stage? Applies to all of the below as well.

print(f" {f}")
print("\nTo do a real release, re-run without --dry-run.")
else:
# Upload artifacts
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest running ruff check --select=ALL --fix on this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants