This repository is a Python package that contains SQLAlchemy data models for use in the CARPI Course Planner project.
In your project's dependency list (often named requirements.txt or similar), add the following line:
carpi-data-model @ git+https://github.com/Project-CARPI/database-schema.git
If installing directly on the command line using pip, use the following command:
pip3 install git+https://github.com/Project-CARPI/database-schema.gitAlong with the core SQLAlchemy models, this repository includes a PyTest-based test suite.
- Python >= 3.10: If you don't have it installed, download it here.
- Docker: Required to automatically spin up temporary MySQL containers during testing. Download Docker Desktop here.
1. Set Up a Virtual Environment To avoid cluttering your global Python environment, create a virtual environment in the project root:
# Create a virtual environment directory named .venv
python -m venv .venv2. Activate the Environment Depending on your operating system, activate the virtual environment:
- Windows:
.venv\Scripts\activate
- macOS / Linux:
source .venv/bin/activate
You will see a (.venv) prefix in your terminal prompt when the environment is successfully active:
(.venv) raymond@Macbook-Pro database-schema %3. Install Required Dependencies With the virtual environment active, install the required packages for testing:
pip install -r requirements.txtOnce your environment is set up and Docker is running in the background, you can execute the test suite using pytest:
pytest tests/To exit the virtual environment when you are finished, run the deactivate command:
deactivate