Skip to content

Latest commit

 

History

History
113 lines (74 loc) · 2.28 KB

DevelopmentSetup.md

File metadata and controls

113 lines (74 loc) · 2.28 KB

Development Setup

Introduction

This page describes how to set up a development environment, and other information useful for developers to be aware of.

Prerequisites

  • Python 3.10

Installing Python with pyenv

The following instructions assume that "pyenv" is installed to enable the setup of an isolated Python environment.

See the following for setup instructions:

Once "pyenv" has been installed, install Python 3.10:

pyenv install 3.10

Installation for development

  1. Clone the "catalog-searcher" Git repository:

    git clone https://github.com/umd-lib/catalog-searcher.git
  2. Switch to the "catalog-searcher" directory:

    cd catalog-searcher
  3. Set up and activate the virtual environment:

    python -m venv .venv --prompt 'catalog-searcher-py3.10'
    source .venv/bin/activate
  4. Run pip install to download dependencies, including those required to run the development tools and test suite:

    pip install -e '.[dev,test]'
  5. Verify the install by running the tests with pytest:

    pytest

Running the Webapp

Create a .env file, then manually update environment variables:

cp env-template .env

To start the app:

python -m flask run

The app will be available at http://localhost:5000

Running in Docker

docker build -t docker.lib.umd.edu/catalog-searcher .
docker run -it --rm -p 5000:5000 --env-file=.env --read-only docker.lib.umd.edu/catalog-searcher

Building for Kubernetes

docker buildx build . --builder=kube -t docker.lib.umd.edu/catalog-searcher:VERSION --push

Code Style

Application code style should generally conform to the guidelines in PEP 8.

This repository is configured to use the ruff linter to check code style. The enabled rule sets are the pycodestyle errors (E) and warnings (W).

ruff check

Type Checking

This repository is configured to use the mypy static type checker. By default, it will check everything in the src directory.

mypy