Skip to content

Commit

Permalink
Update to ipywidgets 8.1.0 (#9)
Browse files Browse the repository at this point in the history
* readme cosmetics
* Update to newer python packages
* bump version 0.8.6 -> 0.9.0

---------

Signed-off-by: Emmanuel Decitre <[email protected]>
  • Loading branch information
decitre authored Aug 27, 2023
1 parent 9e4fe4a commit 857dc90
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3

Expand All @@ -29,7 +29,7 @@ jobs:
- name: Install
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e '.[lab]'
pip install -r requirements/test.txt
- name: Test
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![Python package](https://github.com/heremaps/here-search-demo/actions/workflows/test.yml/badge.svg)](https://github.com/heremaps/here-search-demo/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/heremaps/here-search-demo/branch/main/graph/badge.svg?token=MVFCS4BUFN)](https://codecov.io/gh/heremaps/here-search-demo)
[![lite-badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://decitre.github.io/here-search-demo-updated/lab/?path=demo.ipynb)


# HERE Search notebooks

Expand All @@ -16,7 +18,7 @@ The notebooks can be [used in your browser][3] without further installation.
If you need to install the notebooks or the underlying library on your workstation, run preferably in a virtual environment:

```
pip install here-search-demo
pip install 'here-search-demo[lab]'
```

Link the virtual environment to a IPython kernel:
Expand Down Expand Up @@ -44,6 +46,6 @@ This project is licensed under the MIT license - see the [LICENSE](./LICENSE) fi

[1]: https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/quick-start.html#get-an-api-key
[2]: https://github.com/heremaps/here-search-demo/blob/main/docs/developers.md
[3]: https://heremaps.github.io/here-search-demo/lab/?path=demo.ipynb
[3]: https://decitre.github.io/here-search-demo-updated/lab/?path=demo.ipynb
[4]: https://developer.here.com/documentation/geocoding-search-api/dev_guide/index.html
[5]: https://www.here.com/get-started/pricing
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires = [
build-backend = "setuptools.build_meta"

[tool.bumpver]
current_version = "0.8.6"
current_version = "0.9.0"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
Expand Down
29 changes: 9 additions & 20 deletions requirements/build.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
aiohttp>=3.8.3
argon2-cffi-bindings>=21.2.0
debugpy>=1.6.3
ipykernel>=6.18.0
ipython-genutils>=0.2.0
ipython>=8.10
jupyter-client>=7.4.7
jupyter-server>=1.23.3
jupyterlab>=3.5.0
comm>=0.1.2
jupyterlab-server>=2.19.0
notebook-shim>=0.2.2
nbclassic>=0.4.8
nbconvert>=7.2.5
nbformat>=5.7.0
pygments>=2.13.0
pyzmq>=24.0.1
xyzservices>=2022.9.0
ipyleaflet==0.17.1
ipywidgets==7.7.2
jupyterlab>=3.5.2,<4
jupyterlab_widgets>=1.1.1
jupyterlab-filesystem-access>=0.5.3
jupyterlite~=0.1.2
ipywidgets>=8,<9
ipyleaflet==0.17.3
jupyterlite-core==0.1.2
jupyterlite-pyodide-kernel==0.1.1
libarchive-c
6 changes: 0 additions & 6 deletions requirements/lite_run.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ pytest
pytest-asyncio
pytest-lazy-fixture
pytest-cov

4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
License :: OSI Approved :: MIT License
project_urls =
Bug Tracker = https://github.com/heremaps/here-search-demo/issues
Expand All @@ -43,3 +44,6 @@ here_search.demo.notebooks =
*.ipynb
* =
requirements/*.txt; setup.py; setup.cfg; pyproject.toml

[options.extras_require]
lab = aiohttp; xyzservices
2 changes: 1 addition & 1 deletion src/here_search/demo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
#
###############################################################################

__version__ = "0.8.6"
__version__ = "0.9.0"
8 changes: 5 additions & 3 deletions src/here_search/demo/notebooks/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
"cell_type": "code",
"execution_count": null,
"id": "717d9c13-684f-4ef9-8045-09624217caeb",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"try:\n",
" import piplite\n",
" await piplite.install([\"ipywidgets==7.7.2\", \"ipyleaflet==0.17.1\", \"emfs:here_search_demo-0.8.6-py3-none-any.whl\"], keep_going=True)\n",
" await piplite.install([\"ipywidgets==8.1.0\", \"ipyleaflet==0.17.3\", \"emfs:here_search_demo-0.9.0-py3-none-any.whl\"], keep_going=True)\n",
" api_key = \"<YOUR HERE API KEY>\"\n",
"except ImportError:\n",
" api_key = None"
Expand Down Expand Up @@ -113,7 +115,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.11.3"
},
"toc-autonumbering": false,
"toc-showcode": false,
Expand Down
48 changes: 46 additions & 2 deletions src/here_search/demo/notebooks/obm_1_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"try:\n",
" import piplite\n",
" await piplite.install([\"ipywidgets==7.7.2\", \"ipyleaflet==0.17.1\", \"emfs:here_search_demo-0.8.6-py3-none-any.whl\"], keep_going=True)\n",
" await piplite.install([\"ipywidgets==8.1.0\", \"ipyleaflet==0.17.3\", \"emfs:here_search_demo-0.9.0-py3-none-any.whl\"], keep_going=True)\n",
" api_key = \"<YOUR HERE API KEY>\"\n",
"except ImportError:\n",
" api_key = None"
Expand Down Expand Up @@ -262,23 +262,41 @@
"output_type": "stream",
"text": [
"# query resultType id title \n",
"\n",
"1 'r' administrativeArea here:cm:namedplace:20181414 Regensburg (Landkreis) (R), Bavaria, Germany\n",
"\n",
"2 're' locality here:cm:namedplace:20180814 Regensburg, Bavaria, Germany\n",
"\n",
"3 'res' place here:pds:place:276u31cx-e4c2ca2261114bf6a060240e539aeb76 Königstein Fortress (Restauration Festung)\n",
"\n",
"4 'rest' categoryQuery here:cm:ontology:restaurant Restaurant \n",
"\n",
"5 'resta' categoryQuery here:cm:ontology:restaurant Restaurant \n",
"\n",
"6 'restau' categoryQuery here:cm:ontology:restaurant Restaurant \n",
"\n",
"7 'restaur' categoryQuery here:cm:ontology:restaurant Restaurant \n",
"\n",
"8 'restaura' categoryQuery here:cm:ontology:restaurant Restaurant \n",
"\n",
"9 'restauran' categoryQuery here:cm:ontology:restaurant Restaurant \n",
"\n",
"10 'restaurant' categoryQuery here:cm:ontology:restaurant Restaurant \n",
"\n",
"11 'restaurant ' categoryQuery here:cm:ontology:restaurant Restaurant \n",
"\n",
"12 'restaurant h' place here:pds:place:276u33db-cc50ca74bc7e4e19a646a85abd9ca9ee Adlon Kempinski Berlin (Hotel Adlon Kempinski)\n",
"\n",
"13 'restaurant ha' place here:pds:place:276u30vw-9aa75f80605e4281ae9bb7b985e5c633 Gasthof Hammermuhle (Restaurant Hammermühle)\n",
"\n",
"14 'restaurant ham' place here:pds:place:276u30vw-9aa75f80605e4281ae9bb7b985e5c633 Gasthof Hammermuhle (Restaurant Hammermühle)\n",
"\n",
"15 'restaurant hamb' categoryQuery here:cm:ontology:restaurant-here:cm:namedplace:20151516 Restaurant near Hamburg, Germany\n",
"\n",
"16 'restaurant hambu' categoryQuery here:cm:ontology:restaurant-here:cm:namedplace:20151516 Restaurant near Hamburg, Germany\n",
"\n",
"17 'restaurant hambur' categoryQuery here:cm:ontology:restaurant-here:cm:namedplace:20151516 Restaurant near Hamburg, Germany\n",
"\n",
"18 'restaurant hamburg' categoryQuery here:cm:ontology:restaurant-here:cm:namedplace:20151516 Restaurant near Hamburg, Germany\n"
]
}
Expand Down Expand Up @@ -317,23 +335,41 @@
"output_type": "stream",
"text": [
"# query terms title \n",
"\n",
"1 'r' Regensburg (Landkreis) (R), Bavaria, Germany\n",
"\n",
"2 're' Regensburg Regensburg, Bavaria, Germany\n",
"\n",
"3 'res' Restauration,Restaurant,Resort Königstein Fortress (Restauration Festung)\n",
"\n",
"4 'rest' Restaurant Restaurant \n",
"\n",
"5 'resta' Restaurant Restaurant \n",
"\n",
"6 'restau' Restaurant Restaurant \n",
"\n",
"7 'restaur' Restaurant Restaurant \n",
"\n",
"8 'restaura' Restaurant Restaurant \n",
"\n",
"9 'restauran' Restaurant Restaurant \n",
"\n",
"10 'restaurant' Restaurant \n",
"\n",
"11 'restaurant ' Restaurant \n",
"\n",
"12 'restaurant h' Hotel ,Hanover,Hopfingerbräu Adlon Kempinski Berlin (Hotel Adlon Kempinski)\n",
"\n",
"13 'restaurant ha' Hammermühle,Havelgarten,Hafthorn Gasthof Hammermuhle (Restaurant Hammermühle)\n",
"\n",
"14 'restaurant ham' Hammermühle,Hamburg,Hammers Gasthof Hammermuhle (Restaurant Hammermühle)\n",
"\n",
"15 'restaurant hamb' Hamburg,Hamburger ,Hambacher Restaurant near Hamburg, Germany\n",
"\n",
"16 'restaurant hambu' Hamburg,Hamburger ,Hamburger Restaurant near Hamburg, Germany\n",
"\n",
"17 'restaurant hambur' Hamburg,Hamburger ,Hamburger Restaurant near Hamburg, Germany\n",
"\n",
"18 'restaurant hamburg' Restaurant near Hamburg, Germany\n"
]
}
Expand Down Expand Up @@ -367,13 +403,21 @@
"output_type": "stream",
"text": [
"# query terms title \n",
"\n",
"1 'r' Regensburg (Landkreis) (R), Bavaria, Germany\n",
"\n",
"2 're' Regensburg Regensburg, Bavaria, Germany\n",
"\n",
"3 'res' Restauration,Restaurant,Resort Königstein Fortress (Restauration Festung)\n",
"\n",
"4 'restaurant' Restaurant \n",
"\n",
"5 'restaurant ' Restaurant \n",
"\n",
"6 'restaurant h' Hotel ,Hanover,Hopfingerbräu Adlon Kempinski Berlin (Hotel Adlon Kempinski)\n",
"\n",
"7 'restaurant ha' Hammermühle,Havelgarten,Hafthorn Gasthof Hammermuhle (Restaurant Hammermühle)\n",
"\n",
"8 'restaurant hamburg' Restaurant near Hamburg, Germany\n"
]
}
Expand Down Expand Up @@ -415,7 +459,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.11.3"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions src/here_search/demo/notebooks/obm_2_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"try:\n",
" import piplite\n",
" await piplite.install([\"ipywidgets==7.7.2\", \"ipyleaflet==0.17.1\", \"emfs:here_search_demo-0.8.6-py3-none-any.whl\"], keep_going=True)\n",
" await piplite.install([\"ipywidgets==8.1.0\", \"ipyleaflet==0.17.3\", \"emfs:here_search_demo-0.9.0-py3-none-any.whl\"], keep_going=True)\n",
" api_key = \"<YOUR HERE API KEY>\"\n",
"except ImportError:\n",
" api_key = None"
Expand Down Expand Up @@ -344,7 +344,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.11.3"
}
},
"nbformat": 4,
Expand Down
17 changes: 13 additions & 4 deletions src/here_search/demo/notebooks/obm_3_widget.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "f4878c23-f9ec-4756-b085-bdccf7d726d8",
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-27T12:29:46.153090Z",
"iopub.status.busy": "2023-08-27T12:29:46.152762Z",
"iopub.status.idle": "2023-08-27T12:29:46.161516Z",
"shell.execute_reply": "2023-08-27T12:29:46.160588Z",
"shell.execute_reply.started": "2023-08-27T12:29:46.153058Z"
},
"tags": []
},
"outputs": [],
"source": [
"try:\n",
" import piplite\n",
" await piplite.install([\"ipywidgets==7.7.2\", \"ipyleaflet==0.17.1\", \"emfs:here_search_demo-0.8.6-py3-none-any.whl\"], keep_going=True)\n",
" await piplite.install([\"ipywidgets==8.1.0\", \"ipyleaflet==0.17.3\", \"emfs:here_search_demo-0.9.0-py3-none-any.whl\"], keep_going=True)\n",
" api_key = \"<YOUR HERE API KEY>\"\n",
"except ImportError:\n",
" api_key = None"
Expand Down Expand Up @@ -279,7 +288,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.11.3"
}
},
"nbformat": 4,
Expand Down
46 changes: 31 additions & 15 deletions src/here_search/demo/scripts/lite-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ set -e
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ROOT_DIR="$SCRIPT_DIR"/../../../..
NOTEBOOKS_DIR="$SCRIPT_DIR"/../notebooks
RED='\033[0;31m'
YELLOW='\033[33m'
NC='\033[0m'

serve=1
while getopts n option
Expand All @@ -24,20 +27,33 @@ do
esac
done

printf "${YELLOW}Build workspace${NC}\n"
rm -rf workspace
mkdir -p workspace/content
(cd workspace
python -m venv venv
source venv/bin/activate
python -m pip -q install --upgrade pip
pip install -r "$ROOT_DIR"/requirements/util.txt
pip install -r "$ROOT_DIR"/requirements/lite_run.txt
#pip wheel -e .. --src .. --wheel-dir content --no-deps --no-binary ":all:"
python -m build "$ROOT_DIR" --wheel --outdir content --skip-dependency-check
wheel unpack "$(find content -name '*.whl')" -d package
sed -i.bak '/Requires/d' "$(find package -name METADATA)"
wheel pack "$(dirname "$(find package -name "*.dist-info")")" -d content
cp "$NOTEBOOKS_DIR"/*.ipynb content/
jupyter lite build --contents content --output-dir public --lite-dir public
[ $serve -eq 1 ] && jupyter lite serve --lite-dir public
)

printf "${YELLOW}Create venv${NC}\n"
pushd workspace
python -m venv venv
source venv/bin/activate
python -m pip -q install --upgrade pip

printf "${YELLOW}Install packages${NC}\n"
pip install -r "$ROOT_DIR"/requirements/build.txt
pip install wheel build

printf "${YELLOW}Build here-search-demo wheel${NC}\n"
#pip wheel -e .. --src .. --wheel-dir content --no-deps --no-binary ":all:"
python -m build "$ROOT_DIR" --wheel --outdir content --skip-dependency-check
wheel unpack "$(find content -name '*.whl')" -d package
sed -i.bak '/Requires/d' "$(find package -name METADATA)"
wheel pack "$(dirname "$(find package -name "*.dist-info")")" -d content

printf "${YELLOW}Build Jupyter Lite static page${NC}\n"
cp "$NOTEBOOKS_DIR"/*.ipynb content/
jupyter lite build --contents content --output-dir public --lite-dir public

if [ $serve -eq 1 ]; then
printf "${YELLOW}Serve....${NC}\n"
jupyter lite serve --lite-dir public
fi
popd

0 comments on commit 857dc90

Please sign in to comment.