Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit e4f59ee

Browse files
author
Kharude, Sachin
committed
Added GH actions workflow and binder setup
Signed-off-by: Kharude, Sachin <sachin.kharude@here.com>
1 parent 56849cc commit e4f59ee

File tree

8 files changed

+170
-2
lines changed

8 files changed

+170
-2
lines changed

.github/workflows/main.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
run:
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest]
19+
python-version: [3.8]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Setup conda
25+
uses: conda-incubator/setup-miniconda@v2
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
activate-environment: test
29+
mamba-version: "*"
30+
channels: conda-forge
31+
32+
- name: Conda install dependencies
33+
shell: bash -l {0}
34+
run: |
35+
conda env update --file ci/environment.yml --name test
36+
37+
- name: Install here-location-services
38+
shell: bash -l {0}
39+
run: pip install .
40+
41+
- name: Lint check
42+
shell: bash -l {0}
43+
run: |
44+
make clean
45+
make lint
46+
make typing
47+
48+
- name: Test check
49+
shell: bash -l {0}
50+
env:
51+
XYZ_TOKEN: ${{ secrets.XYZ_TOKEN }}
52+
LS_API_KEY: ${{ secrets.LS_API_KEY }}
53+
run: |
54+
pytest -v --durations=10 --cov-report=xml --cov=here_location_services tests
55+
56+
- name: Upload coverage to Codecov
57+
if: github.ref == 'refs/heads/master' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
58+
uses: codecov/codecov-action@v1
59+
with:
60+
file: ./coverage.xml
61+
flags: unittests
62+
verbose: true
63+
64+
- name: Build Docs and Changelog (Only on Linux for saving time)
65+
if: matrix.os == 'ubuntu-latest'
66+
shell: bash -l {0}
67+
run: |
68+
sh scripts/build_docs.sh

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Python 3.8
12+
uses: actions/setup-python@v2
13+
with:
14+
python-version: 3.8
15+
- name: Install tools
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install setuptools wheel twine
19+
- name: Build the package
20+
run: |
21+
python setup.py sdist bdist_wheel
22+
- name: Publish package
23+
uses: pypa/gh-action-pypi-publish@master
24+
with:
25+
user: __token__
26+
password: ${{ secrets.PYPI_TOKEN }}
27+
verbose: true

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# HERE Location Services for Python
22

3+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/heremaps/here-location-services-python/master?urlpath=lab/tree/docs/notebooks)
4+
35
A Python client for [HERE Location Services](https://developer.here.com/documentation#services).
46

57
## Usage
68
**[Geocoding using HERE Geocoding & Search API](https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-geocode-brief.html).**
7-
# ![Geocoding Example](images/geocoding.gif)
9+
# ![Geocoding Example](https://github.com/heremaps/here-location-services-python/raw/master/images/geocoding.gif)
810

911
## Prerequisites
1012

@@ -42,7 +44,7 @@ $ pytest -v --cov=here_location_services tests
4244

4345
## Documentation
4446

45-
A collection of example notebooks is provided in the [docs/notebooks](./docs/notebooks) directory.
47+
Documentation is available [here](https://here-location-services-python.readthedocs.io/en/latest/).
4648

4749
Run the below commands to build the docs locally:
4850

binder/environment.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: here_location_services
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- pip
6+
- xyzspaces
7+
- jupyterlab==2.2.9
8+
- shapely
9+
- pip:
10+
- here-map-widget-for-jupyter
11+
- "-r ../requirements.txt"
12+
- "-r ../requirements_dev.txt"
13+
- "-r ../docs/requirements.txt"
14+
- "-e ../"

binder/postBuild

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
npm config set @here:registry https://repo.platform.here.com/artifactory/api/npm/here-node/
2+
jupyter nbextension install --py --symlink --sys-prefix here_map_widget
3+
jupyter nbextension enable --py --sys-prefix here_map_widget
4+
jupyter labextension install @jupyter-widgets/jupyterlab-manager js
5+
6+
# Notebooks with extensions that auto-run code must be "trusted" to work the first time
7+
jupyter trust docs/notebooks/*.ipynb
8+
9+
jupyter lab build --dev-build=False --minimize=False

ci/environment.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: test
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- geojson
6+
- requests
7+
- pip:
8+
- "-r ../../requirements_dev.txt"

docs/notebooks/isoline_routing_restaurant_search.ipynb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"<div class=\"alert alert-block alert-warning\">\n",
8+
"<b>Warning:</b> Before running below cells please make sure you have API key. \n",
9+
" Please see <a href=\"https://github.com/heremaps/here-location-services-python/blob/master/docs/notebooks/README.md\">README.md</a> for more info on API key.\n",
10+
"</div>"
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": null,
16+
"metadata": {},
17+
"outputs": [],
18+
"source": [
19+
"import os\n",
20+
"os.environ[\"LS_API_KEY\"] = \"MY-API-KEY\" # replace your API key here."
21+
]
22+
},
323
{
424
"cell_type": "code",
525
"execution_count": null,

docs/notebooks/location_services.ipynb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"<div class=\"alert alert-block alert-warning\">\n",
8+
"<b>Warning:</b> Before running below cells please make sure you have API key. \n",
9+
" Please see <a href=\"https://github.com/heremaps/here-location-services-python/blob/master/docs/notebooks/README.md\">README.md</a> for more info on API key.\n",
10+
"</div>"
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": null,
16+
"metadata": {},
17+
"outputs": [],
18+
"source": [
19+
"import os\n",
20+
"os.environ[\"LS_API_KEY\"] = \"MY-API-KEY\" # replace your API key here."
21+
]
22+
},
323
{
424
"cell_type": "code",
525
"execution_count": null,

0 commit comments

Comments
 (0)