When working with the project, you should create a virtual environment to install the dependencies in the ai-server directory.
python -m venv venv
venv\Scripts\activate
Navigate to the src directory and run the following command:
pip install -r requirements-dev.txt
If you have a problem with the installation, you can try to install the dependencies one by one.
Navigate to the src directory and run the following command:
pip install -e .
This will allow you to make changes to the package and have them reflected in your environment without having to reinstall the package.
- Install the Python extension for VSCode.
- Install the Python Debugger Extension for VSCode.
- Install Pylance for VSCode.
- Install Black Formatter Extension from Microsoft for VSCode.
- Once downloaded, open the setting ctrl+shift+p and then search Open User Settings (JSON)
- Add the following to the JSON file.
"[python]": { "editor.formatOnType": true, "editor.defaultFormatter": "ms-python.black-formatter", "editor.formatOnSave": true }, - Set your Python interpreter to the virtual environment you created.
- To run notebooks inside of VSCode you can install the Jupyter extension. (Optional)
The .vscode/settings.json file allows you to execute scripts directly inside of VSCode. Make sure to set your Python interpreter to the virtual environment you created. Then, with a file open, you can use the play button to run the script.
- Create a new branch for each feature or bug fix.
- Use absolute imports when importing from the
ai_serverpackage. - Run unit tests before making a pull request. (See TESTING.md for instructions)
- Update requirements-dev.txt, pyproject.toml, and setup.py if you add new dependencies.