Skip to content

Technical Details

Amos Chua edited this page Sep 3, 2022 · 7 revisions

Technical Details

Target Minimum Target Maximum
Python 3.10 3.10

NOTE: Please do not use Python versions older than 3.8 because:

  1. f-strings are used
  2. dictionaries are assumed to be ordered

How to test:

Make sure Python is already installed first!

Step 1: Generate the virtual environment

Automated Route:

  • In the root of the repository, find setup.bat and run it.

Manual Route:

  • In the root of the repository, create a virtual environment using Python -m venv venv
    • Substitute "Python" with whichever command you have assigned to Python 3.8 - 3.11
  • Activate the virtual environment using call venv\scripts\activate.bat in Command Prompt
    • The command is venv/scripts/activate in PowerShell
    • Note: PowerShell can take both backslash and forward slashes, but CMD only accepts backslashes
    • Note: You can deactivate the venv by using the command deactivate
  • Use the command pip install -r requirements.txt to install the required modules
    • Use pip install wheel, if the above commands throw errors

Step 2: Import the module

  • In the root of the repository,activate the virtual environment (see above)
  • Start the Python REPL: venv/scripts/python
    • Substitute "python" with whichever command you used in Step 1
  • Import the module: from lazuli.database import Lazuli
  • Proceed with testing. (Examples pending)

Automated Unit Testing

  • Run the SQL script Lazuli/unit_test/SQLScripts/create_tester_accounts.sql to add tester accounts
    • If you used AzureMS's initialisation script, make sure to set the admin account to 0 for the loggedin column in accounts
  • Move the contents of Lazuli/unit_test/tests/ to the root of the repository
    • Note: Copying won't work - there should only be 1 copy of these files in the repository!
  • Run start_test.bat

API Docs

  • API Docs are hosted here