Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .github/actions/build-js/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build JS applet
description: Install Node deps and build the widget JS/CSS assets into the python-wrapper resources.

runs:
using: composite
steps:
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "lts/*"
cache: yarn
cache-dependency-path: js-applet/yarn.lock

# The built assets are not committed; the package needs them on disk to
# build the wheel/sdist and to import the widget in tests.
- name: Build JS applet
shell: bash
run: ./scripts/build_js_applet.sh
3 changes: 3 additions & 0 deletions .github/workflows/gds-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
- name: Install just
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4

- name: Build the JS applet
uses: ./.github/actions/build-js

- name: Run tests
env:
AURA_API_CLIENT_ID: 4V1HYCYEeoU4dSxThKnBeLvE2U4hSphx
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/nvl-entrypoint-test.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,18 @@ jobs:
python-version: "3.11"
enable-cache: true

- name: Build the JS applet
uses: ./.github/actions/build-js

- name: Build release distributions
run: uv build

# setuptools silently omits missing package data, so a forgotten JS build
# would publish a broken wheel; fail before uploading to PyPI. Importing
# the built wheel in a clean env reuses the widget's own asset guard.
- name: Smoke-test the wheel imports
run: uv run --no-project --with "$(ls dist/*.whl)" python -c "import neo4j_viz"

- name: Publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/render-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
with:
python-version: "3.11"
enable-cache: true

- name: Build the JS applet
uses: ./.github/actions/build-js

- run: uv sync --group dev --group docs --extra pandas --extra neo4j --extra gds --extra snowflake

- name: Setup pandoc
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/snowflake-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
with:
python-version: "3.11"
enable-cache: true

- name: Build the JS applet
uses: ./.github/actions/build-js

- run: uv sync --group dev --extra pandas --extra snowflake

- name: Run tests
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
paths:
- "python-wrapper/**" # python code + its resources
- "python-wrapper/pyproject.toml" # dependencies
- "js-applet/**" # built assets are needed to import the widget
- "scripts/build_js_applet.sh"
- ".github/actions/build-js/**"
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
Expand Down Expand Up @@ -38,6 +41,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Build the JS applet
uses: ./.github/actions/build-js

- run: uv sync --group dev --extra pandas --extra neo4j --extra gds --extra snowflake

- name: Run tests
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ just py-sync

This will install all required dev dependencies and install the package in editable mode.

The built widget assets (JS/CSS under `python-wrapper/src/neo4j_viz/resources/`) are
not committed. Build them with:

```sh
just js-build
```

`just py-test` and the CI workflows build them automatically; importing the widget
without them fails with a reminder to run `just js-build`.


## Specifically for this project

Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
- Reduce the widget payload.

## Other changes

- Stop committing the built widget JS/CSS assets; they are now built by `just js-build` and in CI, and the shipped Streamlit stylesheet no longer duplicates the widget's.
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ py-style-gds version="2.0":
UV_NO_SYNC=1 MYPY_TARGETS=python-wrapper/src ./scripts/checkstyle.sh

py-test:
just js-build
cd python-wrapper && uv sync --all-extras --group dev
cd python-wrapper && uv run --group dev pytest

Expand Down
6 changes: 4 additions & 2 deletions python-wrapper/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ __pycache__
build
dist

src/neo4j_viz/resources/*/assets
/src/neo4j_viz/resources/nvl_entrypoint/*Layout.worker*.js
# built widget assets (generated by `just js-build`; bundled into the wheel/sdist
# at build time, never committed)
src/neo4j_viz/resources/nvl_entrypoint/*
src/neo4j_viz/resources/streamlit_v2/*
out/*
1 change: 0 additions & 1 deletion python-wrapper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ neo4j_viz = [
"resources/nvl_entrypoint/style.css",
"resources/nvl_entrypoint/index.html",
"resources/streamlit_v2/graph.js",
"resources/streamlit_v2/style.css",
"py.typed"
]

Expand Down
1,182 changes: 0 additions & 1,182 deletions python-wrapper/src/neo4j_viz/resources/nvl_entrypoint/index.html

This file was deleted.

This file was deleted.

Loading
Loading