Skip to content

Building from Source

Dragon edited this page Dec 22, 2025 · 2 revisions

🏗️ Building NaviDuck from Source

Last updated: 12/22/2025

📋 Quick Start

One-Line Build

# Clone and build in one command
git clone https://github.com/DAPOWER99/NaviDuck.git && cd NaviDuck && python -m pip install -r requirements.txt && python setup.py develop

Build Status

✅ Windows: Fully supported
✅ Linux: Fully supported  
✅ macOS: Fully supported
📱 Android: Via Termux
📱 iOS: Via iSH Shell

🔧 System Requirements

Minimum Requirements

┌──────────────────────────────────────┐
│       Minimum Requirements           │
├──────────────────────────────────────┤
│ 💻 OS: Windows 10, macOS 10.15+,    │
│       Ubuntu 20.04+, or equivalent  │
│ 🐍 Python: 3.8 or newer             │
│ 📦 RAM: 256 MB                       │
│ 💾 Storage: 50 MB free space         │
│ 🌐 Internet: For package downloads   │
└──────────────────────────────────────┘

Recommended Requirements

┌──────────────────────────────────────┐
│      Recommended Requirements        │
├──────────────────────────────────────┤
│ 💻 OS: Windows 11, macOS 12+,       │
│       Ubuntu 22.04+                 │
│ 🐍 Python: 3.10 or newer            │
│ 📦 RAM: 512 MB                       │
│ 💾 Storage: 100 MB free space        │
│ 🎨 Terminal: Supports UTF-8 & colors │
└──────────────────────────────────────┘

🚀 Standard Build Process

Step 1: Get the Source Code

Option A: Clone from GitHub (Recommended)

# Clone the repository
git clone https://github.com/DAPOWER99/NaviDuck.git

# Navigate to project directory
cd NaviDuck

# View available versions
git tag  # Shows release versions
git branch -a  # Shows all branches

Option B: Download ZIP

# Download latest release
curl -L -o naviduck.zip https://github.com/DAPOWER99/NaviDuck/archive/refs/heads/main.zip

# Extract
unzip naviduck.zip
cd NaviDuck-main

Option C: Fork First (For Contributors)

# 1. Fork on GitHub first
# 2. Then clone your fork
git clone https://github.com/YOUR_USERNAME/NaviDuck.git
cd NaviDuck

# Add upstream
git remote add upstream https://github.com/DAPOWER99/NaviDuck.git

Step 2: Set Up Environment

Create Virtual Environment

# Create virtual environment
python -m venv venv

# Activate it:
# Windows:
venv\Scripts\activate
# Linux/macOS:
source venv/bin/activate

# Verify activation (should show (venv) in prompt)
which python  # Should point to venv/bin/python

Alternative: Conda Environment

# Using Conda (optional)
conda create -n naviduck python=3.10
conda activate naviduck

Step 3: Install Dependencies

Basic Installation

# Install core dependencies
pip install -r requirements.txt

# Or install manually
pip install requests colorama

Development Installation

# Install all dependencies (development + optional)
pip install -r requirements.txt

# Or install individually:
pip install requests beautifulsoup4 colorama
pip install pytest pytest-cov black flake8 mypy
pip install pre-commit  # For git hooks

Verify Installation

# Check installed packages
pip list | grep -E "(requests|colorama|pytest)"

# Expected output:
# colorama     0.4.6
# requests     2.31.0
# pytest       7.4.0

Step 4: Build & Install

Install in Development Mode

# Install in development mode (editable)
pip install -e .

# Verify installation
python -c "import naviduck; print(naviduck.__version__)"

Build Distribution Packages

# Build wheel package
python setup.py bdist_wheel

# Build source distribution
python setup.py sdist

# Built packages will be in dist/ directory
ls dist/
# naviduck-1.0.0-py3-none-any.whl
# naviduck-1.0.0.tar.gz

Step 5: Verify Build

Run Tests

# Run unit tests
pytest tests/

# Run with coverage
pytest --cov=naviduck tests/

# Run specific test categories
pytest tests/test_search.py
pytest tests/test_network.py -v  # Verbose output

Test the Application

# Run in test mode
python naviduck.py --test

# Or run normally
python naviduck.py

# Test basic functionality
python -c "
from naviduck.browser_state import BrowserState
state = BrowserState()
print(f'Initialized: {state is not None}')
"

🐧 Platform-Specific Builds

Windows Build

Windows 10/11

# PowerShell as Administrator
# Enable running scripts
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

# Install Python (if not installed)
winget install Python.Python.3.11

# Clone and build
git clone https://github.com/DAPOWER99/NaviDuck.git
cd NaviDuck
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python naviduck.py

Windows Terminal Configuration

// settings.json for Windows Terminal
{
  "profiles": {
    "defaults": {
      "fontFace": "Cascadia Code",
      "fontSize": 11
    },
    "list": [
      {
        "name": "NaviDuck",
        "commandline": "cmd.exe /k \"cd /d C:\\path\\to\\NaviDuck && venv\\Scripts\\activate && python naviduck.py\"",
        "hidden": false
      }
    ]
  }
}

Linux Build

Ubuntu/Debian

# Update system
sudo apt update
sudo apt upgrade -y

# Install Python and tools
sudo apt install python3 python3-pip python3-venv git curl

# Install system dependencies (if needed)
sudo apt install build-essential python3-dev

# Build NaviDuck
git clone https://github.com/DAPOWER99/NaviDuck.git
cd NaviDuck
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Create desktop entry (optional)
sudo cp naviduck.desktop /usr/share/applications/

Arch Linux

# Install Python
sudo pacman -S python python-pip

# Build
git clone https://github.com/DAPOWER99/NaviDuck.git
cd NaviDuck
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Fedora/RHEL

# Install Python
sudo dnf install python3 python3-pip

# Build
git clone https://github.com/DAPOWER99/NaviDuck.git
cd NaviDuck
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

macOS Build

Using Homebrew

# Install Python
brew install python

# Install git if needed
brew install git

# Build NaviDuck
git clone https://github.com/DAPOWER99/NaviDuck.git
cd NaviDuck
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Create alias (optional)
echo "alias naviduck='cd ~/NaviDuck && source venv/bin/activate && python naviduck.py'" >> ~/.zshrc
source ~/.zshrc

Using MacPorts

# Install Python
sudo port install python311
sudo port select --set python python311

# Build
git clone https://github.com/DAPOWER99/NaviDuck.git
cd NaviDuck
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

📱 Mobile & Alternative Platforms

Android (via Termux)

# Install Termux from F-Droid or Play Store
# Then in Termux:

# Update packages
pkg update && pkg upgrade

# Install Python and dependencies
pkg install python git

# Clone and build
git clone https://github.com/DAPOWER99/NaviDuck.git
cd NaviDuck
pip install requests colorama

# Run
python naviduck.py

# Note: Tor requires root or special setup on Android

iOS (via iSH Shell)

# Install iSH Shell from App Store
# Then in iSH:

# Update package list
apk update

# Install Python and dependencies
apk add python3 py3-pip git

# Clone and build
git clone https://github.com/DAPOWER99/NaviDuck.git
cd NaviDuck
pip3 install requests colorama

# Run
python3 naviduck.py

ChromeOS (via Linux Container)

# Enable Linux (Beta) in ChromeOS settings
# Then in Linux terminal:

# Install Python
sudo apt update
sudo apt install python3 python3-pip python3-venv

# Build NaviDuck
git clone https://github.com/DAPOWER99/NaviDuck.git
cd NaviDuck
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

🔧 Advanced Build Options

Building with Tor Support

Install Tor Dependencies

# Windows: Install Tor Browser manually
# Download from: https://www.torproject.org/

# Linux:
sudo apt install tor  # Debian/Ubuntu
sudo dnf install tor  # Fedora
sudo pacman -S tor    # Arch

# macOS:
brew install tor

# Then update TorManager path in code:
# In TorManager.__init__():
self.tor_exe = "/usr/bin/tor"  # Linux/macOS
# or
self.tor_exe = r"C:\Users\You\Desktop\Tor Browser\Browser\TorBrowser\Tor\tor.exe"

Build with Enhanced Tor Features

# Install additional Tor libraries
pip install stem  # Python Tor controller

# Test Tor connection
python -c "
import stem.control
with stem.control.Controller.from_port() as controller:
    controller.authenticate()
    print('Tor version:', controller.get_version())
"

Building with Enhanced Features

Install Optional Dependencies

# For better HTML parsing
pip install beautifulsoup4 lxml html5lib

# For enhanced UI
pip install rich prompt-toolkit

# For async features (future)
pip install aiohttp asyncio

# For data analysis (debugging)
pip install pandas numpy matplotlib

Feature Flags Build

# Create custom build with feature flags
FEATURES = {
    'ENHANCED_PARSING': True,
    'ASYNC_SUPPORT': False,
    'RICH_UI': False,
    'ADVANCED_CACHING': True,
}

# Build with specific features
python setup.py build --features "enhanced_parsing advanced_caching"

Cross-Platform Build

Using PyInstaller

# Install PyInstaller
pip install pyinstaller

# Create executable
pyinstaller --onefile --name naviduck naviduck.py

# With console window (Windows)
pyinstaller --onefile --console naviduck.py

# Without console (GUI-like)
pyinstaller --onefile --windowed naviduck.py

# Add icons
pyinstaller --onefile --icon=icon.ico naviduck.py

Using Nuitka (Alternative)

# Install Nuitka
pip install nuitka

# Compile to executable
python -m nuitka --onefile naviduck.py

# With optimizations
python -m nuitka --onefile --enable-plugin=tk-inter naviduck.py

🏗️ Development Builds

Setting Up Development Environment

Complete Dev Setup Script

#!/bin/bash
# setup-dev.sh

set -e  # Exit on error

echo "🚀 Setting up NaviDuck development environment..."

# Clone repository
if [ ! -d "NaviDuck" ]; then
    git clone https://github.com/DAPOWER99/NaviDuck.git
fi
cd NaviDuck

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Upgrade pip
pip install --upgrade pip

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

# Install pre-commit hooks
pre-commit install

# Run tests
pytest tests/ -v

# Create development config
cp config.example.json config.dev.json

echo "✅ Development environment setup complete!"
echo "👉 Activate with: source venv/bin/activate"
echo "👉 Run tests: pytest"
echo "👉 Start NaviDuck: python naviduck.py --debug"

Development Configuration

// config.dev.json
{
  "environment": "development",
  "debug": true,
  "log_level": "DEBUG",
  "test_mode": true,
  "cache_enabled": false,
  "mock_responses": true,
  "features": {
    "experimental": true,
    "unsafe": false
  }
}

Continuous Integration Build

GitHub Actions Workflow

# .github/workflows/build.yml
name: Build and Test

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        python-version: ['3.8', '3.9', '3.10', '3.11']
    
    steps:
    - uses: actions/checkout@v3
    
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}
    
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements-dev.txt
    
    - name: Lint with flake8
      run: |
        flake8 naviduck.py --count --max-complexity=10 --statistics
    
    - name: Test with pytest
      run: |
        pytest tests/ --cov=naviduck --cov-report=xml
    
    - name: Build package
      run: |
        python setup.py sdist bdist_wheel
    
    - name: Upload artifacts
      uses: actions/upload-artifact@v3
      with:
        name: dist-${{ matrix.os }}-${{ matrix.python-version }}
        path: dist/

Docker Build

Dockerfile

# Dockerfile
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    curl \
    tor \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy application
COPY . .

# Create non-root user
RUN useradd -m -u 1000 naviduck
USER naviduck

# Run Tor in background and start NaviDuck
CMD tor & python naviduck.py

Docker Compose

# docker-compose.yml
version: '3.8'

services:
  naviduck:
    build: .
    container_name: naviduck
    volumes:
      - ./data:/home/naviduck/.naviduck
    ports:
      - 8080:8080
    environment:
      - TOR_ENABLED=true
      - DEBUG=false
    command: python naviduck.py --host 0.0.0.0 --port 8080

Build and Run with Docker

# Build image
docker build -t naviduck .

# Run container
docker run -it --rm naviduck

# Run with volume for persistent data
docker run -it --rm -v naviduck_data:/home/naviduck/.naviduck naviduck

# Run with compose
docker-compose up

🔐 Security-Focused Builds

Build with Enhanced Security

Install Security Tools

# Security-focused dependencies
pip install bandit safety pyre-check

# Run security checks
bandit -r naviduck.py
safety check

Hardened Build Script

#!/bin/bash
# build-secure.sh

# Build with security flags
export CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2"
export LDFLAGS="-Wl,-z,now,-z,relro"

# Install in isolated environment
python -m venv secure_venv --without-pip
source secure_venv/bin/activate

# Install with hash checking
pip install --require-hashes -r requirements-secure.txt

# Build with security audit
python setup.py build --security-audit

Build for Air-Gapped Systems

# On internet-connected machine
# Download all dependencies
pip download -r requirements.txt -d offline_packages

# Copy to air-gapped machine
# Then install from local packages
pip install --no-index --find-links=offline_packages -r requirements.txt

# Build without network access
python setup.py build --offline

📊 Performance-Optimized Builds

Build with Performance Flags

Install Performance Tools

# Performance monitoring
pip install py-spy memory_profiler line_profiler

# Optimized dependencies
pip install lxml  # Faster than BeautifulSoup
pip install orjson  # Faster JSON parsing
pip install uvloop  # Faster async (if using async)

Performance Build Script

#!/bin/bash
# build-perf.sh

# Set optimization flags
export CFLAGS="-O3 -march=native"
export CXXFLAGS="-O3 -march=native"

# Install with optimizations
pip install --no-binary :all: -r requirements.txt

# Build with optimizations
python setup.py build --optimize

Benchmarking Build

# Create benchmark build
python setup.py build --benchmark

# Run performance tests
python -m pytest tests/performance/ -v

# Profile memory usage
python -m memory_profiler naviduck.py

# Profile CPU usage
python -m cProfile -o profile.stats naviduck.py

🧪 Testing Builds

Build for Different Test Scenarios

Unit Test Build

# Minimal build for unit tests
pip install pytest pytest-cov pytest-mock
python setup.py build --test-unit
pytest tests/unit/

Integration Test Build

# Build with integration test dependencies
pip install pytest-docker pytest-selenium
python setup.py build --test-integration
pytest tests/integration/

End-to-End Test Build

# Full build for E2E tests
pip install playwright pytest-playwright
python -m playwright install
python setup.py build --test-e2e
pytest tests/e2e/

Coverage Build

# Build with coverage instrumentation
python setup.py build --coverage

# Run tests with coverage
pytest --cov=naviduck --cov-report=html tests/

# View coverage report
open htmlcov/index.html  # Or on Windows: start htmlcov/index.html

🔧 Custom Builds

Feature-Based Builds

Build Specific Features Only

# Build with only search features
python setup.py build --features "search"

# Build with AI features only
python setup.py build --features "ai"

# Build with privacy features
python setup.py build --features "tor privacy"

# Build minimal version
python setup.py build --minimal

Configuration-Based Build

# config_custom.py
BUILD_CONFIG = {
    'features': {
        'search': True,
        'ai': True,
        'tor': False,
        'bookmarks': True,
        'history': False,
    },
    'optimizations': {
        'caching': True,
        'compression': True,
    },
    'dependencies': {
        'required': ['requests'],
        'optional': ['beautifulsoup4', 'colorama'],
    }
}

# Build with custom config
python setup.py build --config config_custom.py

Platform-Specific Optimizations

Windows-Specific Optimizations

# Build for Windows with optimizations
$env:PYTHONOPTIMIZE = "2"
python setup.py build --platform windows --optimize

# Include Windows-specific dependencies
pip install pywin32 pythoncom

Linux-Specific Optimizations

# Build for Linux with system optimizations
export CFLAGS="-O2 -pipe"
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
python setup.py build --platform linux --optimize

macOS-Specific Optimizations

# Build for macOS with optimizations
export ARCHFLAGS="-arch x86_64 -arch arm64"
export CFLAGS="-O2"
python setup.py build --platform macos --universal

📦 Packaging for Distribution

Create Installable Package

Setup.py Configuration

# setup.py
from setuptools import setup, find_packages

setup(
    name="naviduck",
    version="1.0.0",
    packages=find_packages(),
    install_requires=[
        "requests>=2.25.0",
        "colorama>=0.4.4",
    ],
    extras_require={
        'dev': [
            'pytest>=6.0',
            'pytest-cov>=2.0',
            'black>=21.0',
            'flake8>=3.9',
        ],
        'tor': [
            'stem>=1.8.0',
        ],
        'full': [
            'beautifulsoup4>=4.9.0',
            'lxml>=4.6.0',
            'rich>=10.0.0',
        ]
    },
    entry_points={
        'console_scripts': [
            'naviduck=naviduck.main:main',
        ],
    },
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
    python_requires='>=3.8',
)

Build Distribution Packages

# Clean previous builds
rm -rf build/ dist/ *.egg-info/

# Build source distribution
python setup.py sdist

# Build wheel
python setup.py bdist_wheel

# Build universal wheel
python setup.py bdist_wheel --universal

# Build for specific Python version
python setup.py bdist_wheel --python-tag py38

# Verify packages
twine check dist/*

Create Standalone Executable

Using PyInstaller

# Basic executable
pyinstaller --onefile naviduck.py

# With console
pyinstaller --onefile --console naviduck.py

# With data files
pyinstaller --onefile --add-data "icons/*:icons" naviduck.py

# With icon
pyinstaller --onefile --icon=icon.ico naviduck.py

# Create directory bundle
pyinstaller --onedir naviduck.py

Using cx_Freeze

# Install cx_Freeze
pip install cx_Freeze

# Build executable
python setup.py build_exe

# With optimizations
python setup.py build_exe --optimize 2

Create System Packages

DEB Package (Ubuntu/Debian)

# Install packaging tools
sudo apt install devscripts debhelper dh-python

# Create Debian package
dpkg-buildpackage -us -uc

# Or using stdeb
pip install stdeb
python setup.py --command-packages=stdeb.command bdist_deb

RPM Package (Fedora/RHEL)

# Install packaging tools
sudo dnf install rpm-build rpmdevtools

# Setup build environment
rpmdev-setuptree

# Create spec file
python setup.py bdist_rpm --spec-only

# Build RPM
rpmbuild -ba python-naviduck.spec

PKGBUILD (Arch Linux)

# Create PKGBUILD file
cat > PKGBUILD << 'EOF'
# Maintainer: Your Name <email@example.com>
pkgname=naviduck
pkgver=1.0.0
pkgrel=1
pkgdesc="CLI browser with AI features"
arch=('any')
url="https://github.com/DAPOWER99/NaviDuck"
license=('MIT')
depends=('python' 'python-requests' 'python-colorama')
makedepends=('python-setuptools')
source=("https://github.com/DAPOWER99/NaviDuck/archive/v$pkgver.tar.gz")
sha256sums=('SKIP')

build() {
  cd "$srcdir/NaviDuck-$pkgver"
  python setup.py build
}

package() {
  cd "$srcdir/NaviDuck-$pkgver"
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}
EOF

# Build package
makepkg -si

🚀 Quick Build Recipes

One-Minute Build

# For quick testing
curl -s https://raw.githubusercontent.com/DAPOWER99/NaviDuck/main/naviduck.py > naviduck.py
python -c "import requests; print('Dependencies OK')" 2>/dev/null || pip install requests
python naviduck.py --test

Developer Quick Build

#!/bin/bash
# dev-build.sh
git pull
source venv/bin/activate
pip install -U -r requirements-dev.txt
pytest tests/ -xvs
python naviduck.py --debug

Production Build

#!/bin/bash
# prod-build.sh
set -e
python -m venv venv_prod
source venv_prod/bin/activate
pip install -U pip
pip install -r requirements.txt --no-deps
python setup.py bdist_wheel
# Verify with:
python -m py_compile naviduck.py

🐛 Troubleshooting Build Issues

Common Build Problems

Python Version Issues

# Check Python version
python --version

# If wrong version, specify explicitly
python3.10 naviduck.py
# or
py -3.10 naviduck.py  # Windows

Permission Issues

# Fix virtual environment permissions
sudo chown -R $USER:$USER venv/

# Fix pip permissions
pip install --user package_name

# Or use sudo (not recommended)
sudo pip install package_name

Missing Dependencies

# Linux: Install system packages
sudo apt install python3-dev  # Debian/Ubuntu
sudo dnf install python3-devel  # Fedora
sudo pacman -S python  # Arch

# macOS: Install command line tools
xcode-select --install

# Windows: Install Visual C++ Build Tools
# Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/

Build Error Solutions

"ModuleNotFoundError: No module named 'requests'"

# Install missing module
pip install requests

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

"SSL: CERTIFICATE_VERIFY_FAILED"

# Update certificates
pip install --upgrade certifi

# Or temporarily bypass (not recommended for production)
export PYTHONHTTPSVERIFY=0

"Could not find a version that satisfies the requirement"

# Update pip
pip install --upgrade pip

# Try with different index
pip install -i https://pypi.org/simple/ package_name

# Or install from source
pip install git+https://github.com/user/repo.git

Platform-Specific Issues

Windows Issues

# "python is not recognized"
# Add Python to PATH or use:
py naviduck.py

# Virtual environment activation fails
# Use absolute path:
C:\path\to\venv\Scripts\activate

# File path too long
# Enable long paths in Windows Registry
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f

macOS Issues

# Python 2 vs Python 3
# Always use python3
python3 naviduck.py

# Certificate issues
# Install certificates
/Applications/Python\ 3.*/Install\ Certificates.command

# Homebrew Python not in PATH
echo 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.zshrc

Linux Issues

# Missing tkinter
sudo apt install python3-tk  # Debian/Ubuntu

# Permission denied
sudo chmod +x naviduck.py

# Terminal encoding issues
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

🔍 Verifying Your Build

Build Verification Tests

Quick Verification Script

#!/bin/bash
# verify-build.sh

echo "🔍 Verifying NaviDuck build..."

# Check Python version
python --version | grep -q "Python 3" || echo "❌ Wrong Python version"

# Check dependencies
python -c "import requests; import colorama; print('✅ Dependencies OK')"

# Run unit tests
pytest tests/unit/ -q

# Test basic functionality
python -c "
from naviduck import BrowserState, SearchManager
state = BrowserState()
print(f'✅ BrowserState: {state}')
"

# Test CLI
python naviduck.py --help | grep -q "NaviDuck" && echo "✅ CLI works"

echo "🎉 Build verification complete!"

Comprehensive Test Suite

# Run all verification steps
./scripts/verify-build.sh

# Check code quality
flake8 naviduck.py
black --check naviduck.py
mypy naviduck.py

# Security audit
bandit -r naviduck.py

# Performance benchmark
python -m pytest tests/performance/ -v

📈 Build Performance Tips

Optimize Build Time

# Use pip cache
export PIP_CACHE_DIR=~/.cache/pip

# Parallel builds (if supported)
python setup.py build -j 4

# Skip unnecessary steps
python setup.py build --skip-tests

# Use pre-built wheels
pip install --only-binary :all: -r requirements.txt

Reduce Package Size

# Clean build artifacts
python setup.py clean --all

# Remove unnecessary files
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} +

# Create minimal distribution
python setup.py bdist --format=zip --minimal

🎯 Build Success Checklist

Before Distribution

  • All tests pass
  • No syntax errors
  • Dependencies are correctly specified
  • Documentation is updated
  • Version number is correct
  • License files included
  • Security audit completed
  • Performance benchmarks passed
  • Cross-platform compatibility verified

After Build

  • Executable runs without errors
  • All features work as expected
  • No missing dependencies
  • Build artifacts are clean
  • Digital signatures applied (if applicable)
  • Release notes updated

🆘 Getting Help with Builds

Common Resources

# Check existing issues
https://github.com/DAPOWER99/NaviDuck/issues

# Search for similar problems
https://stackoverflow.com/questions/tagged/python+cli

# Python packaging documentation
https://packaging.python.org/

# Platform-specific guides
# Windows: https://docs.python.org/3/using/windows.html
# macOS: https://docs.python.org/3/using/mac.html
# Linux: https://docs.python.org/3/using/unix.html

Ask for Help

When asking for build help, include:

  1. Full error message
  2. Python version (python --version)
  3. Operating System
  4. Steps you tried
  5. Relevant logs

Last updated: 12/22/2025
Building from Source Guide version: 3.0

Remember: If you encounter build issues, check the Troubleshooting Guide for solutions to common problems.

Happy building! 🏗️🦆

Clone this wiki locally