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
14 changes: 6 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
yarn-version: [1.22.22]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Install here-map-widget-for-jupyter
run: |
npm config set @here:registry https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript
pip install .[dev]
pip install .[docs]

- name: Check installation files
run: |
Expand All @@ -53,24 +53,22 @@ jobs:
test -f $CONDA_PREFIX/share/jupyter/labextensions/@here/map-widget-for-jupyter/package.json

- name: Lint check
run: make lint
run: |
pip install hatch
hatch run lint:check

- name: Import check
run: python -c 'import here_map_widget'

- name: Build the package (Only on Linux for saving time)
if: matrix.os == 'ubuntu-latest'
run: |
pip install hatch
hatch build
run: hatch build

- name: Build docs (Only on Linux for saving time)
if: matrix.os == 'ubuntu-latest'
env:
XYZ_TOKEN: ${{ secrets.XYZ_TOKEN }}
LS_API_KEY: ${{ secrets.LS_API_KEY }}
run: |
mamba install sphinx sphinx_rtd_theme
pip install -r docs/requirements.txt
cd docs
make html
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ jobs:
- name: Install tools
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine jupyter-packaging
pip install hatch
- name: Build the package
run: |
node --version
npm --version
yarn --version
npm config set @here:registry https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript
pip install .
pip install hatch
hatch build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
Expand Down
15 changes: 9 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
*.egg-info/
.ipynb_checkpoints/
.idea/
.vscode/
build/
*.py[cod]
src/*
venv/

# Compiled javascript
# Main module
*.py[cod]
here_map_widget/static/
here_map_widget/nbextension/
here_map_widget/labextension/

# Package
*.egg-info/
dist/

# OS X
.DS_Store

# Notebooks
.ipynb_checkpoints/

# Source javascript
js/.yarn/
js/dist/
Expand Down
6 changes: 0 additions & 6 deletions .isort.cfg

This file was deleted.

8 changes: 4 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ formats:

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
version: 3.12
install:
- requirements: requirements.txt
- requirements: requirements_dev.txt
- requirements: docs/requirements.txt
- requirements: docs/requirements.txt
- method: pip
path: .
43 changes: 36 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,58 @@ These are mostly guidelines, not rules. Use your best judgement and feel free to
changes to this document in a pull request.

## Coding Guidelines
1. Lint your code contributions as per [pep8 guidelines](https://www.python.org/dev/peps/pep-0008/).

To help you out, we have included a `Makefile` in the root directory which supports the commands below:
### 1. Lint your code contributions as per [pep8 guidelines](https://www.python.org/dev/peps/pep-0008/).

To help you out, we have scripts in `pyproject.toml` which supports the commands below:

Autoformat code using black:

```bash
make black
hatch run lint:reformat
```

Check for linting errors:

```bash
make lint
hatch run lint:check
```

2. Sort the imports in each python file as per [pep8 guidelines](https://www.python.org/dev/peps/pep-0008/#imports)
Please execute the isort utility to have the imports sorted auto-magically.
Make sure [hatch](https://hatch.pypa.io/1.13/) CLI is installed via an installer, pip, or conda beforehand.

### 2. Sort the imports in each python file as per [pep8 guidelines](https://www.python.org/dev/peps/pep-0008/#imports)

Please execute the isort utility to have the imports sorted auto-magically.

#### Notebooks
## Notebooks

Example notebooks are provided in [/examples](./examples).

## Edit documentation

Source of documentaion is available in [/docs](./docs).

Following commands build documentation

```bash
cd docs
make html
```

## Rebuild

The following command allows you to delete final and intermediate artifacts from the project directory.

```bash
hatch run clean-all
```

It's possible to try dry-run before executing removal.

```bash
hatch run clean-all-dry
```

## Signing each Commit

When you file a pull request, we ask that you sign off the
Expand Down
38 changes: 0 additions & 38 deletions Makefile

This file was deleted.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Use [HERE Maps API for JavaScript](https://developer.here.com/develop/javascript

Before you can install this package, or use the example notebooks to make sure your system meets the following prerequisities:

- A Python installation, 3.6+ recommended, with the `pip` command available to install dependencies
- A Python installation, 3.9+ recommended, with the `pip` command available to install dependencies
- A HERE developer account, free and available under [HERE Developer Portal](https://developer.here.com)
- An [API key](https://developer.here.com/documentation/identity-access-management/dev_guide/topics/dev-apikey.html) from the [HERE Developer Portal](https://developer.here.com)

Expand Down Expand Up @@ -79,12 +79,12 @@ Below extra commands are required only if you are using JupyterLab (version 2 or

### Installation from source repository on GitHub

For a development installation (requires yarn, you can install it with `conda install -c conda-forge yarn`):
For a development installation (requires yarn v1, you can install it with `conda install -c conda-forge yarn@1.22.22`):

$ npm config set @here:registry https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript
$ git clone https://github.com/heremaps/here-map-widget-for-jupyter.git
$ cd here-map-widget-for-jupyter
$ pip install -e .
$ pip install -e . # Or .[docs]

If you are using the classic Jupyter Notebook you need to install the nbextension:

Expand All @@ -96,6 +96,7 @@ If you are using the classic Jupyter Notebook you need to install the nbextensio
Note for developers:

- the ``-e`` pip option allows one to modify the Python code in-place. Restart the kernel in order to see the changes.
- the ``[docs]`` key allows one to install optional-dependencies to build docs.
- the ``--symlink`` argument on Linux or OS X allows one to modify the JavaScript code in-place. This feature is not available with Windows.

For developing with JupyterLab:
Expand Down
11 changes: 8 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,24 @@ This document describes the release process of here-map-widget-for-jupyter, and

The following are mandatory pre-release steps to bring the repository into a proper shape:

- Update versions in [pyproject.toml](pyproject.toml)
- Update versions in [here_map_widget/_version.py](here_map_widget/_version.py) as desired.
- Update versions in [here_map_widget/__about__.py](here_map_widget/__about__.py) as desired.
- Update [js/package.json](js/package.json) with new npm package version.
- Make sure all tests listed in `CONTRIBUTING.md` pass successfully.
- Make sure badges appear as expected in the [README.md on GitHub](https://github.com/heremaps/here-map-widget-for-jupyter/blob/master/README.md).

## Packaging
- Make sure [hatch](https://hatch.pypa.io/1.13/) CLI is installed via an installer, pip, or conda.
- Run `hatch build`
- Make sure sdist and wheel packages are created in [dist](dist/).
- Make sure the wheel package works by `pip install /path/to/dist/directory/here_map_widget_for_jupyter-version-py2.py3-none-any.whl`.
- Create a Merge Request in the GitHub.

## Release on PyPI

- Create a new release in the GitHub UI by clicking on [Draft a new release](https://github.com/heremaps/here-map-widget-for-jupyter/releases/new) button, then update the tag version and release description.
- Click on the `Publish release` button to release the [package on PyPI](https://pypi.org/project/here-map-widget-for-jupyter/).
- Once released verify that `pip install here-map-widget-for-jupyter` does indeed install the latest release.


## Release on Anaconda's conda-forge channel

- Go to the [here-map-widget-for-jupyter-feedstock](https://github.com/conda-forge/here-map-widget-for-jupyter-feedstock) repository.
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sphinx
jupyter-sphinx==0.2.4a1
sphinx_rtd_theme
pandas
geopandas
here-map-widget-for-jupyter
6 changes: 1 addition & 5 deletions here_map_widget/_version.py → here_map_widget/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
version_info = (2, 0, 0)

# Module version accessible using here_map_widget.__version__
__version__ = "%s.%s.%s" % (
version_info[0],
version_info[1],
version_info[2],
)
__version__ = "2.0.0"

EXTENSION_VERSION = "^2.0.0"
2 changes: 1 addition & 1 deletion here_map_widget/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import xyzservices.providers as basemaps # noqa E501

from ._version import __version__, version_info
from .__about__ import __version__, version_info
from .configs import *
from .map import *

Expand Down
2 changes: 1 addition & 1 deletion here_map_widget/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
validate,
)

from ._version import EXTENSION_VERSION
from .__about__ import EXTENSION_VERSION
from .configs import DefaultLayerNames

def_loc = [20.5937, 78.9629]
Expand Down
1 change: 1 addition & 0 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
],
"scripts": {
"clean": "rimraf dist/ && rimraf ../here_map_widget/labextension/ && rimraf ../here_map_widget/nbextension",
"cleanAll": "yarn run clean && rimraf yarn.lock",
"prepublish": "webpack --mode=production",
"build": "webpack --mode=production",
"build:extensions": "webpack --mode=production && jupyter labextension build .",
Expand Down
Loading
Loading