Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release] Candidate Kepler-Jupyter v0.3.4 #2588

Merged
merged 17 commits into from
Dec 27, 2024
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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
.venv/
.conda/
node_modules/
__pycache__/
build/
29 changes: 19 additions & 10 deletions .github/workflows/build-publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on: push
jobs:
build_and_publish:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -54,17 +55,15 @@ jobs:
- name: Check Release Tag
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+-jupyter$ ]]; then
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+([a|b][0-9])?-jupyter$ ]]; then
echo ::set-output name=publish::true
fi

- name: Publish KeplerGL to Pypi
if: steps.check-tag.outputs.publish == 'true'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
run: |
python -m twine upload bindings/kepler.gl-jupyter/dist/*.tar.gz
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'

- name: Publish kepler-jupyter to NPM
if: steps.check-tag.outputs.publish == 'true'
Expand All @@ -74,4 +73,14 @@ jobs:
run: |
source venv/bin/activate
cd bindings/kepler.gl-jupyter/js
npm publish
echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" > .npmrc
npm config set registry https://registry.npmjs.org/
npm whoami
npm config ls
npm publish --verbose --access public

- name: Publish KeplerGL to Pypi
if: steps.check-tag.outputs.publish == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: bindings/kepler.gl-jupyter/dist/
36 changes: 36 additions & 0 deletions bindings/kepler.gl-jupyter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# NOTE: PLEASE run `yarn build` before running this dockerfile
FROM ubuntu:latest

# Install python3
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv

# Install gdal
RUN apt-get install -y gdal-bin

# Fix: No such file or directory: 'gdal-config'
RUN apt-get install -y libgdal-dev

# Make the current directory the working directory
WORKDIR /kepler.gl

# The current directory is <Root>/bindings/kepler.gl-jupyter
# Copy the root directory contents into the working directory
COPY . .

# Create a virtual environment .venv
RUN python3 -m venv .venv

# Activate the virtual environment
RUN . .venv/bin/activate

# Install jupyter_packaging using pip
RUN .venv/bin/pip install jupyter_packaging


# Install keplergl-jupyter in the virtual environment from the current directory
RUN .venv/bin/pip install .

# Run jupyter notebook with token exposed in logs
CMD [".venv/bin/jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root", "--NotebookApp.log_level='INFO'"]

EXPOSE 8888
4 changes: 2 additions & 2 deletions bindings/kepler.gl-jupyter/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ NOTE: __Version number of the js module **`kelergl-jupyter`** and the python mod

Update `version_info` in keplergl/_version.py in bindings/kepler.gl-jupyter folder.
Update `"version": "0.x.x"` to match the version info in js/package.json in bindings/kepler.gl-jupyter folder.
Update `EXTENSION_SPEC_VERSION` to match the js module version. Update `version` in js/package
Update `EXTENSION_SPEC_VERSION` to match the js module version.

```
git add keplergl/_version.py
Expand All @@ -25,7 +25,7 @@ Create a tag: `<version>-jupyter` e.g. v0.3.4-jupyter

```
git tag -a <version>-jupyter -m "<version>-jupyter"
git push origin master && git push origin <version>-jupyter
git push origin <version>-jupyter
```

The new tag will trigger the Github Action `build-publish-pypi.yml`: __"Build KeplerGL Python and NPM packages"__. The packages will be built and tested, then published to NPM and PyPI using the secret tokens.
Expand Down
2 changes: 1 addition & 1 deletion bindings/kepler.gl-jupyter/js/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# kperlgl-jupyter
# keplergl-jupyter

This is a simple jupyter widget for kepler.gl, an advanced geospatial visualization tool, to render large-scale interactive maps.

Expand Down
33 changes: 17 additions & 16 deletions bindings/kepler.gl-jupyter/js/lib/keplergl-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@ import log from './log';

// When serialiazing the entire widget state for embedding, only values that
// differ from the defaults will be specified.

export const KeplerGlModal = widgets.DOMWidgetModel.extend({
defaults: {
...widgets.DOMWidgetModel.prototype.defaults(),
_model_name: 'KeplerGlModal',
_view_name: 'KeplerGlView',
_model_module: 'keplergl-jupyter',
_view_module: 'keplergl-jupyter',

data: {},
config: {}
// Note: in JavaScript, class.extend does not inherently inherit static functions.
export class KeplerGlModal extends widgets.DOMWidgetModel {
defaults() {
return {
...super.defaults(),
_model_name: 'KeplerGlModal',
_model_module: 'keplergl-jupyter',
_view_name: 'KeplerGlView',
_view_module: 'keplergl-jupyter',
data: {},
config: {}
};
}
});
}

export const KeplerGlView = widgets.DOMWidgetView.extend({
export class KeplerGlView extends widgets.DOMWidgetView {
render() {
log('KeplerGlModal start render');
this.keplergl = new KeplerGlJupyter();
Expand All @@ -46,17 +47,17 @@ export const KeplerGlView = widgets.DOMWidgetView.extend({
this.model.on('change:config', this.config_changed, this);

window.dom = this.el;
},
}

data_changed() {
log('KeplerGlModal start data_changed');

this.keplergl.onDataChange(this);
},
}

config_changed() {
log('KeplerGlModal start config_change');

this.keplergl.onConfigChange(this);
}
});
}
4 changes: 2 additions & 2 deletions bindings/kepler.gl-jupyter/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "keplergl-jupyter",
"version": "0.3.4a0",
"version": "0.3.4",
"description": "This is a simple jupyter widget for kepler.gl, an advanced geo-spatial visualization tool, to render large-scale interactive maps.",
"author": "Shan He",
"license": "MIT",
Expand Down Expand Up @@ -69,7 +69,7 @@
"webpack-stats-plugin": "^0.2.1"
},
"dependencies": {
"@jupyter-widgets/base": "^2 || ^3 || ^4.0.0",
"@jupyter-widgets/base": "^6",
"@jupyterlab/builder": "^4.0.0",
"@kepler.gl/actions": "^3.0.0",
"@kepler.gl/components": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion bindings/kepler.gl-jupyter/js/webpack/build-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module.exports = (rules, plugins) => ({
`https://unpkg.com/styled-components@${VERSIONS.styledComponents}/dist/styled-components.min.js`,

// load kepler.gl last
`https://unpkg.com/kepler.gl@${VERSIONS.keplergl}/umd/keplergl.min.js`
// `https://unpkg.com/kepler.gl@${VERSIONS.keplergl}/umd/keplergl.min.js`
],
title: 'Kepler.gl'
}),
Expand Down
Loading
Loading