Development notes

Install the development version from Github

Development version can be installed with pip or uv from Github with:

# With pip
pip install git+https://github.com/Lifemap-ToL/pylifemap.git@bundle
# Add to a project with uv
uv add git+https://github.com/Lifemap-ToL/pylifemap.git@bundle
# Run python with uv
uv run --with git+https://github.com/Lifemap-ToL/pylifemap.git@bundle python

Install the development version from source

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

  • Install node.js
  • Install uv
  • Clone the pylifemap repository
  • Install Python dependencies with : uv sync
  • Install JavaScript dependencies with : npm install
  • Bundle JavaScript and CSS code with npm run bundle

Widget JavaScript modification and bundling

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

# Bundle and minify both deck and no_deck versions
npm run bundle
# Bundle with deck.gl without minifying and watch for code change
npm run dev_deck
# Bundle with deck.gl without minifying and watch for code change
npm run dev_nodeck

Two bundles are created:

  • A bundle including deck.gl, in src/pylifemap/static/deck
  • A smaller bundle without deck.gl, in src/pylifemap/static/nodeck

One bundle or the other is used by the widget depending on the presence of deck.gl layers.

Tests

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

npm 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:

npm run doc

Docker image

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

docker build . -t pylifemap

Release notes

  • Change version in NEWS.md and pyproject.toml
  • Run uv sync to update lock file
  • Cleanup the previous builds in dist/
  • Bundle and minify JS and CSS and build package with npm run build
  • Release the Python package with uv publish in pylifemap
  • Tag the version in git
  • Create a release on Github
  • Bump to dev version in pyproject.toml and NEWS.md