Complete guide for setting up the LFS-Ayats development environment.
git clone https://github.com/YOUR_USERNAME/LFS-Ayats.git
cd LFS-Ayats
# Add upstream to synchronize
git remote add upstream https://github.com/lfsplayer97/LFS-Ayats.git
# Create virtual environment
python3 -m venv venv
# Activate
source venv/bin/activate
# Verify
which python # Should show path inside venv/
# Create virtual environment
python -m venv venv
# Activate
venv\Scripts\activate
# Verify
where python # Should show path inside venv\
# Production and development dependencies
pip install -r requirements.txt
# Install package in editable mode
pip install -e .
# Verify installation
pip list | grep lfs-ayats
Install extensions:
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension ms-python.black-formatter
code --install-extension ms-python.flake8
Configuration (.vscode/settings.json):
{
"python.defaultInterpreterPath": "${workspaceFolder}/venv/bin/python",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--line-length", "88"],
"editor.formatOnSave": true,
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false
}
venv/bin/python# Install pre-commit
pip install pre-commit
# Configure hooks
pre-commit install
# Run manually
pre-commit run --all-files
Configuration (.pre-commit-config.yaml):
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3.12
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
# All tests
pytest
# With coverage
pytest --cov=src --cov-report=html
# Specific tests
pytest tests/unit/
pytest tests/integration/
# Quick tests (without integration)
pytest -m "not integration"
# Copy example configuration
cp config.example.yaml config.yaml
# Edit for your needs
nano config.yaml # or vim, code, etc.
Run the verification script to ensure everything is configured correctly:
# From the project root directory
python scripts/verify_setup.py
This script verifies:
Expected output:
============================================================
LFS-Ayats Setup Verification
============================================================
✓ [PASS] Python version: 3.12.3
✓ [PASS] Virtual environment detected
✓ [PASS] Core dependencies installed
✓ [PASS] Package installed in editable mode
✓ [PASS] Project structure is complete
✓ [PASS] Configuration file exists
✓ [PASS] Tests can be executed
============================================================
Summary
============================================================
Checks passed: 7/7
✓ All checks passed! Your environment is properly configured.
If any verification fails, the script will show the steps to correct it.
# Synchronize with upstream
git fetch upstream
git merge upstream/main
# Create branch for feature
git checkout -b feature/new-functionality
# Or for bug fix
git checkout -b fix/fix-bug
# Edit files...
# Format code
black src/ tests/
# Verify style
flake8 src/ tests/
# Type checking
mypy src/
# Unit tests
pytest tests/unit/
# Complete tests
pytest --cov=src
# Add files
git add .
# Commit with descriptive message
git commit -m "feat: add new functionality X"
# Pre-commit hooks will run automatically
# Push to fork
git push origin feature/new-functionality
# Create PR from GitHub web interface
# Install pip
python -m ensurepip --upgrade
# Reinstall in editable mode
pip install -e .
# Verify PYTHONPATH
echo $PYTHONPATH
# Add if necessary
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
# Reinstall hooks
pre-commit uninstall
pre-commit install
# Update hooks
pre-commit autoupdate
git fetch upstream && git merge upstream/mainNow you’re ready to contribute! 🚀