Development notes

Install from git

To install pylifemap from git:

pip install git+https://github.com/Lifemap-ToL/pylifemap.git

Install fom source

If you want to build pylifemap from source, you’ll have to follow these steps:

  • Install node.js
  • Install hatch dependency management system
  • Clone the pylifemap repository
  • Install Python dependencies with : hatch shell
  • Install JavaScript dependencies with : npm install --workspaces --include-root-workspace

Widget JavaScript modification and bundling

Each time the widget JavaScript or CSS code is modified in the src/js/ or packages/lifemapjs/ directories, it must be bundled with one of the following commands in pylifemap:

# Bundle
npm run bundle
# Build (bundle + minify)
npm run build
# Bundle and watch for code change
npm run dev

The result is put into src/pylifemap/static.

Tests

Python tests are in the tests directory and can be run with:

hatch run test

Documentation

The package documentation is in doc/. It is managed by quarto and quartodoc.

To build it in HTML format in doc/_site/you can run:

hatch run doc

Docker image

To build the docker image manually, run the following at the root of the repisotory:

docker build . -t pylifemap

Maintenance notes

Releases

  • Change version in NEWS.md and src/pylifemap/__about__.py
  • Release the Python package with hatch build and hatch publish in pylifemap
  • Tag the version in git
  • Create a release on Github
  • Bump to dev version in pyproject.toml and NEWS.md