Contributing

The source code can be found on Codeberg and on Sourcehut.

Questions and bug reports can be sent to the Ebookrack mailing list. Please include “ebk-find” in the subject line.

Please review the design documents to understand the goals and constraints of the project.

See below for how to set up a development environment for working on the code.

Development setup

Use the system package manager to install the following dependencies:

  • make
  • black
  • flake8
  • reuse*
  • pytest
  • mandoc – only for the docs
  • pandoc – only for the docs
  • python3-matplotlib – only for the benchmarks
  • python3-pandas – only for the benchmarks
  • hut – only for publishing the docs

* Install it with pipx if the package provided by your system is too old.

On systems that don’t bundle the venv module with Python, e.g. Debian, also install the python3-venv package.

Clone this repo and create and activate a virtualenv:

git clone https://git.sr.ht/~javiljoen/ebookrack-finder
cd ebookrack-finder
python3 -m venv --clear --system-site-packages .venv
source .venv/bin/activate  # or ...
source .venv/bin/activate.fish

Install the ebookrack_finder package in editable mode:

pip install -e .

Note: The above steps only need to be performed once. You will, however, have to activate the virtualenv at the start of every development session.

Running development tasks

Development tasks are defined in the Makefile. Run the desired tasks with make, e.g.:

make check test

The available tasks are as follows:

  • fmt: Format the source files
  • check: Run the linters
  • test: Run the tests
  • site: Build the documentation site
  • upload-docs: Upload the documentation site
  • benchmarks: Run the benchmarks and plot the results
  • clean: Remove the build, documentation, and test artifacts

Note: Running make by itself is equivalent to running make check test.

To publish the documentation site to Sourcehut Pages, run the following (after changing the URL in the Makefile to match your Sourcehut user name):

make site upload-docs