Skip to content

Getting Started

Shamik Karkhanis edited this page Jun 3, 2025 · 16 revisions

Getting Started:

1. Installing Python:

Ensure that you have Python 3.12 or newer installed on your system by running the following command:

python3 --version

If Python is not installed, or you need a different version, follow the installation instructions for your operating system from the official Python documentation: https://www.python.org/downloads/.

2. Project Setup:

You'll need to clone the repository containing the project. Open your terminal and execute the following command:

git clone https://github.com/CApy-RPI/app.git
cd app

3. Managing Dependencies

3.1 Dependency Management

  • Use a virtual environment to manage dependencies:
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On Unix/MacOS
source .venv/bin/activate

3.2 Installing Requirements

  • Use requirements.txt for production dependencies and requirements_dev.txt for development dependencies:
# Install production dependencies
pip install -r requirements.txt

# Install development dependencies
pip install -r requirements_dev.txt

3.3 requirements.txt vs requirements_dev.txt

  • requirements.txt: Contains the dependencies required for the application to run in production.
  • requirements_dev.txt: Contains additional dependencies required for development, such as testing and linting tools.

Example requirements.txt:

discord.py
pymongo

Example requirements_dev.txt:

pytest
flake8
black
mypy

3.4 .env

  • Use '.env' file to hold all sensitive access tokens.
  • Ask your project lead for access to these tokens.
  • The .env file must be located in the directory from which you run the bot.

4. Running the Bot

.venv\Scripts\activate
python src/capy_app/main.py

If using the above to run the bot: .env must be in src/

Clone this wiki locally