This page describes how to set up a development environment, and other information useful for developers to be aware of.
- Python 3.10
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
-
Clone the "catalog-searcher" Git repository:
git clone https://github.com/umd-lib/catalog-searcher.git
-
Switch to the "catalog-searcher" directory:
cd catalog-searcher
-
Set up and activate the virtual environment:
python -m venv .venv --prompt 'catalog-searcher-py3.10' source .venv/bin/activate
-
Run
pip install
to download dependencies, including those required to run the development tools and test suite:pip install -e '.[dev,test]'
-
Verify the install by running the tests with pytest:
pytest
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
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
docker buildx build . --builder=kube -t docker.lib.umd.edu/catalog-searcher:VERSION --push
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
This repository is configured to use the mypy static type checker. By default, it will check everything in the src directory.
mypy