Ctrl K
ComunidadGuías…

setup.py

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup script for hart-backend package (formerly hevolve-backend).

HART OS - Hevolve Hive Agentic Runtime.
Crowdsourced compute infrastructure for autonomous Hive AI Training.
"""

from setuptools import setup, find_packages
import os

# Read the README for long description
here = os.path.abspath(os.path.dirname(__file__))
try:
    with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
        long_description = f.read()
except FileNotFoundError:
    long_description = "HART OS - Hevolve Hive Agentic Runtime: Crowdsourced compute infrastructure for autonomous Hive AI Training."

# Core dependencies required for the server to run
# Pin versions with upper bounds to prevent pip backtracking.
# Updated 2026-03-03 to match installed versions.
install_requires = [
    # Web framework
    "Flask>=3.0.0,<4.0.0",
    "waitress>=3.0.0,<4.0.0",
    "fastapi>=0.100.0,<1.0.0",
    "uvicorn>=0.30.0,<1.0.0",
    "starlette>=0.40.0,<1.0.0",

    # Database — hevolve-database is the single source of truth for all models
    "hevolve-database @ git+https://github.com/hertz-ai/Hevolve_Database.git@realistic_intro_video",
    "SQLAlchemy>=2.0.0,<3.0.0",
    "redis>=7.0.0,<8.0.0",

    # LangChain ecosystem -pinned to avoid pip backtracking (40+ version checks)
    "langchain-classic>=1.0.0,<2.0.0",
    "langchain-core>=1.2.0,<2.0.0",
    "langchain-text-splitters>=1.0.0,<2.0.0",
    "langsmith>=0.3.0,<1.0.0",

    # LLM providers
    "openai>=2.0.0,<3.0.0",
    "groq>=0.5.0,<1.0.0",

    # ML/Vector stores (optional heavy deps -install separately if needed)
    # "chromadb>=0.3.0",
    # "faiss-cpu>=1.7.0",
    # "sentence-transformers>=2.2.0",

    # Core utilities
    "python-dotenv>=1.0.0,<2.0.0",
    "pydantic>=2.0.0,<3.0.0",
    "aiohttp>=3.9.0,<4.0.0",
    "aiofiles>=23.2.0,<26.0.0",
    "requests>=2.31.0,<3.0.0",
    "httpx>=0.27.0,<1.0.0",

    # Data processing
    "numpy>=1.25.0,<2.0.0",
    "pandas>=2.0.0,<4.0.0",
    "beautifulsoup4>=4.12.0,<5.0.0",
    # The book pipeline's one PDF engine (see requirements.txt for why).
    "pypdfium2>=5.13.0,<6.0.0",

    # Tokenization
    "tiktoken>=0.5.0,<1.0.0",
    "transformers>=5.0.0,<6.0.0",

    # Security
    "cryptography>=41.0.0,<47.0.0",
    "PyJWT>=2.7.0,<3.0.0",

    # Communication
    "crossbarhttp3>=1.1,<2.0",
    "websockets>=11.0.0,<17.0",

    # Image processing
    "Pillow>=9.5.0,<13.0.0",
    "opencv-python",

    # Speech-to-text (ONNX runtime -no PyTorch needed, CPU-optimized)
    "sherpa-onnx>=1.11.0",

    # Other utilities
    "pytz>=2023.3",
    "python-multipart>=0.0.6,<1.0.0",
    "tenacity>=8.2.0,<10.0.0",
    "tqdm>=4.65.0,<5.0.0",
    "coloredlogs>=15.0.0,<16.0.0",
    "PyYAML>=6.0,<7.0",

    # LiveKit (Phase 7d.B) — voice/video/screen-share SFU token signer.
    # Hard dep so every build target (pip / ISO / Docker / PEX) gets
    # the JWT signer.  Dev-key bootstrap in livekit_service handles the
    # config side automatically — see ~/.hevolve/livekit_dev.json.
    "livekit-api>=1.0.0,<2.0.0",
]

# Optional dependencies for specific features
extras_require = {
    "telegram": ["python-telegram-bot>=21.0"],
    "discord": ["discord.py>=2.3.0"],
    "torch": [
        "torch>=2.1.0",
        "torchvision>=0.16.0",
    ],
    "google": [
        "google-cloud-aiplatform>=1.36.0",
        "google-cloud-bigquery>=3.13.0",
        "google-cloud-storage>=2.13.0",
        "google-api-python-client>=2.90.0",
    ],
    "memory": ["simplemem>=0.1.0"],
    # biometrics: ML deps (insightface, speechbrain) belong in HevolveAI, not HARTOS
    "remote-desktop": [
        "mss>=9.0.0",
        "websockets>=12.0",
        "av>=12.0.0,<19",
        "pynput>=1.7.0",
    ],
    "dev": [
        "pytest>=7.0.0",
        "pytest-asyncio>=0.21.0",
        "pytest-cov>=4.0.0",
        "black>=23.0.0",
        "flake8>=6.0.0",
        "mypy>=1.0.0",
    ],
    "all": [
        "python-telegram-bot>=21.0",
        "discord.py>=2.3.0",
        "torch>=2.1.0",
        "torchvision>=0.16.0",
        "google-cloud-aiplatform>=1.36.0",
        "google-cloud-bigquery>=3.13.0",
        "google-cloud-storage>=2.13.0",
        "google-api-python-client>=2.90.0",
        "simplemem>=0.1.0",
    ],
}

setup(
    name="hart-backend",
    # version derived from git tags via setuptools-scm (configured in pyproject.toml)
    setup_requires=["setuptools-scm>=8.0"],
    author="HART Team",
    author_email="contact@hevolve.ai",
    description="HART OS - Hevolve Hive Agentic Runtime: Crowdsourced compute infrastructure for autonomous Hive AI Training. Distributed thought process across crowdsourced agents, distributed coding agents incentivizing compute providers, self-sustaining economy at national scale so no single entity, government, or corporation monopolizes AI. Intelligence belongs to the people. Only the master key (held by human stewards) can halt the being. Every engineering decision is transparent by design.",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/hertz-ai/HARTOS",
    license="Apache-2.0",

    # Package discovery.  agent_ledger lives in-tree at
    # agent-ledger-opensource/agent_ledger/ and is callers' top-level
    # import (`from agent_ledger import SmartLedger`).  We vendor it
    # into hart-backend via package_dir so a clean
    # `pip install hart-backend` ships it as
    # ``<site-packages>/agent_ledger/`` alongside core/integrations/security.
    # Future: when agent-ledger is published to PyPI standalone, replace
    # this vendor mapping with a top-level dependency.
    packages=(
        find_packages(
            include=[
                "core", "core.*",
                "hartos",
                "integrations", "integrations.*",
                "security", "security.*",
                "hart_sdk", "hart_sdk.*",
            ],
            exclude=[
                "venv", "venv*",
                "tests", "tests.*",
                "docs",
                "*.tests", "*.tests.*",
                "__pycache__",
            ],
        )
        + find_packages(
            where="agent-ledger-opensource",
            include=["agent_ledger", "agent_ledger.*"],
            exclude=["tests", "tests.*", "examples", "examples.*"],
        )
    ),
    package_dir={
        "agent_ledger": "agent-ledger-opensource/agent_ledger",
    },

    # Include main modules at root level
    # Only the entry/facade surface stays flat at the repo root. The
    # implementation modules live in the hartos/ package (moved 2026-08-30);
    # they ship via find_packages() below, not py_modules.
    py_modules=[
        "hart_version",
        "hart_intelligence",
        "hart_intelligence_entry",
        "embedded_main",
        "asgi",
    ],

    # Include non-Python files
    include_package_data=True,
    package_data={
        # *.js/*.svg/*.css bundle the glass-shell static assets
        # (integrations/agent_engine/static/*) into wheels/sdists — without them
        # a non-source install serves /shell/static 404s and the desktop is dead.
        "": ["*.yaml", "*.yml", "*.json", "*.txt", "*.md", "*.js", "*.svg", "*.css"],
    },

    # Python version requirement
    python_requires=">=3.9",

    # Dependencies
    install_requires=install_requires,
    extras_require=extras_require,

    # Entry points for console scripts
    entry_points={
        "console_scripts": [
            "hart=hartos.hart_cli:hart",
            "hart-server=hart_intelligence:main",
            "hart-crossbar=hartos.crossbar_server:main",
        ],
    },

    # Classification metadata
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
        "Topic :: Software Development :: Libraries :: Python Modules",
    ],

    # Keywords for PyPI search
    keywords=[
        "langchain",
        "ai",
        "chatbot",
        "agent",
        "llm",
        "openai",
        "groq",
        "flask",
        "multi-agent",
        "orchestration",
    ],

    # Project URLs
    project_urls={
        "Bug Reports": "https://github.com/hertz-ai/HARTOS/issues",
        "Source": "https://github.com/hertz-ai/HARTOS",
        "Documentation": "https://docs.hevolve.ai",
    },
)