Skip to content

Latest commit

 

History

History
244 lines (174 loc) · 4.34 KB

File metadata and controls

244 lines (174 loc) · 4.34 KB

Quick Start - Flowfull-Python Client

🚀 Quick Installation (Windows)

Step 1: Open PowerShell in the project folder

cd C:\Users\NotsideRC\Documents\NTSD\2\pbfl\packages\flowfull-clients\flowfull-python

Step 2: Install Dependencies

Option A - Global Installation (Simpler):

pip install -r requirements-dev.txt

Option B - Virtual Environment (Recommended):

# Create virtual environment
python -m venv venv

# Activate virtual environment
.\venv\Scripts\Activate.ps1

# Install dependencies
pip install -r requirements-dev.txt

Step 3: Run Tests

python run_tests.py

Or directly:

python -m pytest

📦 Where Are Packages Installed?

Global Installation

pip install package

📍 Installed at: C:\Users\NotsideRC\AppData\Local\Programs\Python\Python3XX\Lib\site-packages

Advantages:

  • Available for all projects
  • No need to activate anything

Disadvantages:

  • Can cause conflicts between projects
  • Difficult to maintain different versions

Virtual Environment (Recommended)

python -m venv venv
.\venv\Scripts\Activate.ps1
pip install package

📍 Installed at: .\venv\Lib\site-packages (this project only)

Advantages:

  • Isolated per project
  • No version conflicts
  • Easy to clean (just delete venv folder)

Disadvantages:

  • Need to activate environment each time
  • Takes more space (each project has its packages)

🔄 Do I Need to Restart?

NO you don't need to restart the computer after installing packages.

You only need to:

  1. Close and reopen the terminal if you installed something new
  2. Or simply run the command again

🧪 Testing Commands

Run All Tests

python run_tests.py

Run with Coverage

python run_tests.py --cov

Run with Verbose Output

python run_tests.py --verbose

Run Fast Tests

python run_tests.py --fast

Use pytest Directly

# All tests
python -m pytest

# With verbose
python -m pytest -v

# With coverage
python -m pytest --cov=core --cov-report=html

# Specific test
python -m pytest tests/test_client.py

# Specific test with verbose
python -m pytest tests/test_client.py -v

🛠️ Troubleshooting

Error: "pytest is not recognized"

Solution:

# Install pytest
pip install pytest

# Or install all dependencies
pip install -r requirements-dev.txt

Error: "No module named 'core'"

Solution:

# Make sure you're in the correct folder
cd C:\Users\NotsideRC\Documents\NTSD\2\pbfl\packages\flowfull-clients\flowfull-python

# Run tests
python -m pytest

Error: "Permission denied" when activating virtual environment

Solution:

# Run PowerShell as Administrator and execute:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

# Then try again:
.\venv\Scripts\Activate.ps1

Changes are not reflected

Solution:

  1. Close and reopen the terminal
  2. If using virtual environment, deactivate and activate again:
    deactivate
    .\venv\Scripts\Activate.ps1

📊 View Coverage Report

After running with coverage:

python run_tests.py --cov

Open the HTML report:

# Open in browser
start htmlcov\index.html

💡 Recommendations

For Development

  1. Use virtual environment to keep the project isolated
  2. Run tests frequently to catch errors early
  3. Review coverage to ensure everything is tested

For Quick Testing

  1. Global installation if you just want to test quickly
  2. Use python run_tests.py to run tests easily
  3. Use --fast for quick tests during development

📝 Complete Example

# 1. Navigate to folder
cd C:\Users\NotsideRC\Documents\NTSD\2\pbfl\packages\flowfull-clients\flowfull-python

# 2. Install dependencies (first time only)
pip install -r requirements-dev.txt

# 3. Run tests
python run_tests.py

# 4. View coverage
python run_tests.py --cov
start htmlcov\index.html

✅ Verify Installation

# Verify Python
python --version

# Verify pip
pip --version

# Verify pytest
python -m pytest --version

# List installed packages
pip list

Ready to start! 🎉