Skip to content

Voltage Park migration -- set up workflows and pre-commit#39

Merged
DorisMai merged 12 commits into
mainfrom
vp_migration
Mar 10, 2026
Merged

Voltage Park migration -- set up workflows and pre-commit#39
DorisMai merged 12 commits into
mainfrom
vp_migration

Conversation

@DorisMai

@DorisMai DorisMai commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

This PR is intended for auxiliary changes to facilitate migration the repo development to Voltage Park and future collaborative development. Changes should not interfere with parallel work on ESM embedding.

Issues I would like to address include:

@DorisMai DorisMai mentioned this pull request Mar 1, 2026
@DorisMai
DorisMai force-pushed the vp_migration branch 2 times, most recently from 0a3b459 to 54649a3 Compare March 2, 2026 01:34
@DorisMai
DorisMai force-pushed the vp_migration branch 3 times, most recently from 1f36a79 to ec4cb30 Compare March 2, 2026 19:39
Doris Mai and others added 3 commits March 2, 2026 11:53
Steps 3 & 4: drop all 17 nvidia-*-cu12 packages (transitive from
torch==2.8.0 cu126 build) and ~85 other transitive packages that uv
resolves automatically. Direct dependencies only remain.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@DorisMai
DorisMai marked this pull request as ready for review March 4, 2026 03:04
@@ -0,0 +1,39 @@
name: Build

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.

Have you tested this yet? I'm not sure this package will build on the standard GitHub runners (in fact, I'm pretty sure it won't, since there are CUDA requirements like torch-geometric, but I could be wrong). We want to do this kind of testing (I have a similar file for sampleworks waiting in the wings) but we need our own runners first. Moody has this in the works, and it should be ready next week AFAIK.

@DorisMai DorisMai Mar 5, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

build with the existing pyproject.toml actually ran fine? Technically the torch related packages can be installed with cpu kernels and the current tests don't seem to require gpu. But yes I am aware that the current workflow won't work for gpu explicit test. look forward to our own runner.

Comment thread .github/workflows/build.yml Outdated
- name: Run tests
env:
TEST_DATA_DIR: ${{ github.workspace }}/tests/test_files
run: uv run pytest

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.

Might be good to make sure we have a certain test coverage too. Can be added later, if so please add an issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

addressed in build workflow

Comment thread .github/workflows/lint.yml Outdated
run: uv sync --group dev

- name: Run mypy
run: uv run mypy src/

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.

You might look at astral's new ty package. It is really fast.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

wow this is fast. replacing mypy with ty now.

DorisMai added a commit that referenced this pull request Mar 9, 2026
This PR changes the `tests` to prepare for PR #39 that sets up build
workflow and helps clean up dependencies.

Changes are minimal. Functionally, the main change is replacing a
hard-coded data file path with a relative one. This involves moving the
`test_files` folder inside `test`. A `conftest.py` script is added to
reduce some boiler plates on fixture.
vratins added a commit that referenced this pull request Mar 9, 2026
Small PR that adds graph creation constants to `constants.py` and makes
changes to `utils.py` to use those constants (as well slightly improving
the tqdm logging utility function.

Also makes formatting changes to util plotting functions.

Style changes (organizing import order) should be addressed after merging PR #39 and #45 where pre-commit hooks run to check and fix these things (address issue #27 ).
@DorisMai

DorisMai commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator Author

@vratins can you take a look (mostly at the pre-commit hook and lint.yml)? If you run other kinds of lint/format and type checks or have specific configurations feel free to edit (and update dependencies as needed in your README PR)

@vratins vratins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It LGTM, there are dependencies missing in the documentation/READme PR toml file (like ruff), I'll change that. Also I use mypy and not ty but I can update to ty.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds CI infrastructure and pre-commit configuration to support migration of the repo to Voltage Park and future collaborative development. It addresses Issue #27 (add pre-commit checks) and adds GitHub Actions workflows for linting/type-checking and building/testing.

Changes:

  • Added .pre-commit-config.yaml with hooks for ruff (linting + formatting) and ty (type checking)
  • Added .github/workflows/lint.yml to run ruff auto-fixes and ty type checking on push/PR to main
  • Added .github/workflows/build.yml to run pytest with coverage (currently only triggered manually via workflow_dispatch)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
.pre-commit-config.yaml Configures ruff and ty pre-commit hooks for local developer use
.github/workflows/lint.yml CI workflow: auto-fix and commit ruff formatting, then run ty type checker
.github/workflows/build.yml CI workflow: run pytest with coverage (currently disabled for push/PR triggers)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .pre-commit-config.yaml Outdated
name: ty check
# Use uv if replacing mypy with ty in dev dependency group
entry: uvx ty check
language: python No newline at end of file

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The pre-commit hook for ty is missing the pass_filenames: false setting. By default, pre-commit passes the list of changed files as arguments to the entry command. Since uvx ty check is designed to check a whole project rather than individual files, having filenames passed as arguments may cause unexpected behavior or errors. Adding pass_filenames: false ensures the command is invoked without file arguments, letting ty check the full project context.

Suggested change
language: python
language: python
pass_filenames: false

Copilot uses AI. Check for mistakes.
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The github.head_ref context variable is only populated for pull_request events, not for push events. Since this workflow triggers on both push and pull_request (lines 4–7), when a push to main occurs, github.head_ref will be an empty string. Passing an empty string as the ref parameter to actions/checkout may cause unexpected behavior (checking out an empty ref or failing). Consider using a conditional such as ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} to handle both trigger types correctly.

Suggested change
ref: ${{ github.head_ref }}
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/lint.yml Outdated
with:
commit_message: "Auto-commit ruff fixes [skip ci]"
commit_username: "Autoformatter"
commit_email: "Autoformatter <actions@github.com>"

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The commit_email field for stefanzweifel/git-auto-commit-action expects a plain email address, not a "Name " formatted string. Passing "Autoformatter <actions@github.com>" in this field will likely result in a malformed git commit with an invalid email. The commit_username field should hold the name (which is already correctly set on line 33), and commit_email should hold only the email address (e.g., "actions@github.com").

Suggested change
commit_email: "Autoformatter <actions@github.com>"
commit_email: "actions@github.com"

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/build.yml Outdated
uses: astral-sh/setup-uv@v7
with:
version: "0.10.6"
python: ${{ matrix.python-version }}

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The astral-sh/setup-uv action uses python-version as the input parameter name for specifying the Python version, not python. Using the incorrect parameter name means the Python version will not be set, and the action will use its default. This same issue exists in lint.yml line 46. Please rename python to python-version in both workflow files.

Suggested change
python: ${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/lint.yml Outdated
uses: astral-sh/setup-uv@v7
with:
version: "0.10.6"
python: "3.12"

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

Same as build.yml: the astral-sh/setup-uv action uses python-version as the input parameter name, not python. The Python version specified here will be silently ignored, and the action will use its default Python version instead.

Suggested change
python: "3.12"
python-version: "3.12"

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +8
# push:
# branches: [main]
# pull_request:
# branches: [main]
workflow_dispatch:

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The push and pull_request triggers for the Build workflow are commented out, meaning this workflow is only triggered manually via workflow_dispatch. The PR description explicitly states the goal is to "force all pushes and PR on the main branch to pass the pytests." With the current configuration, the build/test step will never run automatically on pushes or pull requests. The trigger section should be uncommented to achieve the stated goal.

Copilot uses AI. Check for mistakes.
@DorisMai DorisMai changed the title Voltage Park migration Voltage Park migration -- set up workflows and pre-commit Mar 10, 2026
@DorisMai
DorisMai merged commit 2307fca into main Mar 10, 2026
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.

4 participants