Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] update keplergl-jupyter widget for JupyterLab 3, add build for…
… conda-forge (#1572) 1. Upgrade keplergl-jupyter widget for JupyterLab 3 2. Add build script to build keplergl-jupyter for jupyterlab separately using @jupyter/builder 3. Upgrade build script setup.py using jupyter_packaging library 4. Add support to Google colab (no interaction with widget because of lacking colab support). New function show() was proposed 5. Add GitHub Actions “build-publish-pypi.yml” to build, test and publish (when tag release) keplergl python package to PyPI: 6. Add condo-forge/keplergl-feedstock repo: https://github.com/lixun910/staged-recipes/tree/keplergl-feedstock (transfer to keplergl org later) Signed-off-by: Xun Li <lixun910@gmail.com>
- Loading branch information
Showing
9 changed files
with
405 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Build KeplerGL Python and NPM Packages | ||
|
||
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]')" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12.x | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine virtualenv | ||
- name: Build KeplerGL | ||
env: | ||
MapboxAccessTokenJupyter: ${{ secrets.MAPBOXTOKEN }} | ||
run: | | ||
python -m virtualenv venv | ||
source venv/bin/activate | ||
pip install jupyter jupyterlab jupyter-packaging | ||
cd bindings/kepler.gl-jupyter | ||
python setup.py sdist | ||
- name: Test KeplerGL | ||
run: | | ||
source venv/bin/activate | ||
pip install bindings/kepler.gl-jupyter/dist/*.tar.gz | ||
if [ ! -f "venv/share/jupyter/nbextensions/keplergl-jupyter/index.js" ]; then | ||
venv/bin/jupyter nbextension install --py --sys-prefix keplergl | ||
venv/bin/jupyter nbextension enable --py --sys-prefix keplergl | ||
fi | ||
venv/bin/jupyter nbconvert --execute bindings/kepler.gl-jupyter/notebooks/DataFrame.ipynb --to python | ||
python bindings/kepler.gl-jupyter/notebooks/DataFrame.py | ||
- name: Create artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: keplergl-pypi | ||
path: bindings/kepler.gl-jupyter/dist/ | ||
|
||
- name: Check Release Tag | ||
id: check-tag | ||
run: | | ||
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[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: Publish kepler-jupyter to NPM | ||
if: steps.check-tag.outputs.publish == 'true' | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||
run: | | ||
cd bindings/kepler.gl-jupyter/js | ||
npm publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
recursive-include keplergl/static *.* | ||
recursive-include keplergl-jupyter/labextension *.* | ||
include keplergl-jupyter.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.