Metadata-Version: 2.4
Name: ud-resolver
Version: 1.1.12
Summary: A universal dependency resolver supporting multiple package ecosystems
Author-email: Universal Dependency Resolver Team <team@udr.example.com>
License: MIT
Project-URL: Homepage, https://github.com/code-with-zeeshan/universal-dependency-resolver
Project-URL: Repository, https://github.com/code-with-zeeshan/universal-dependency-resolver
Project-URL: Documentation, https://github.com/code-with-zeeshan/universal-dependency-resolver
Keywords: dependency,resolver,package-manager,compatibility
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: <4.0,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi<0.137,>=0.115.0
Requires-Dist: uvicorn<0.50,>=0.24
Requires-Dist: pydantic<3,>=2.5.0
Requires-Dist: aiohttp<4,>=3.9
Requires-Dist: requests<3,>=2.31
Requires-Dist: beautifulsoup4<5,>=4.12
Requires-Dist: packaging<27,>=23.2
Requires-Dist: tomli-w<2,>=1.0
Requires-Dist: toml<1,>=0.10
Requires-Dist: pyyaml<7,>=6.0.1
Requires-Dist: networkx<4,>=3.2.1
Requires-Dist: z3-solver<5,>=4.12
Requires-Dist: sqlalchemy<3,>=2.0.23
Requires-Dist: alembic<2,>=1.12
Requires-Dist: slowapi<1,>=0.1.9
Requires-Dist: email-validator<3,>=2.1
Requires-Dist: python-multipart<1,>=0.0.6
Requires-Dist: jinja2<4,>=3.1.2
Requires-Dist: structlog<25,>=24.1
Requires-Dist: prometheus-fastapi-instrumentator<7,>=6.1
Provides-Extra: system
Requires-Dist: psutil<6,>=5.9.6; extra == "system"
Requires-Dist: py-cpuinfo<10,>=9.0; extra == "system"
Requires-Dist: distro<2,>=1.8; extra == "system"
Requires-Dist: gputil<2,>=1.4; extra == "system"
Requires-Dist: nvidia-ml-py<13,>=12.535; extra == "system"
Provides-Extra: security
Requires-Dist: python-jose[cryptography]<4,>=3.3; extra == "security"
Requires-Dist: passlib[bcrypt]<2,>=1.7.4; extra == "security"
Requires-Dist: bcrypt<5; extra == "security"
Provides-Extra: dev
Requires-Dist: pytest<8,>=7.4; extra == "dev"
Requires-Dist: pytest-asyncio<1,>=0.21; extra == "dev"
Requires-Dist: pytest-cov<6,>=4.1; extra == "dev"
Requires-Dist: httpx<1,>=0.25; extra == "dev"
Requires-Dist: black<24,>=23.11; extra == "dev"
Requires-Dist: flake8<7,>=6.1; extra == "dev"
Requires-Dist: mypy<2,>=1.7; extra == "dev"
Requires-Dist: bandit<2,>=1.7; extra == "dev"
Provides-Extra: postgres
Requires-Dist: psycopg2-binary<3,>=2.9.9; extra == "postgres"
Requires-Dist: redis<6,>=5.0.1; extra == "postgres"
Requires-Dist: celery<6,>=5.3.4; extra == "postgres"
Requires-Dist: aiocache<1,>=0.12.2; extra == "postgres"
Provides-Extra: monitoring
Requires-Dist: opentelemetry-api<2,>=1.22; extra == "monitoring"
Requires-Dist: opentelemetry-sdk<2,>=1.22; extra == "monitoring"
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.43b0; extra == "monitoring"
Requires-Dist: opentelemetry-instrumentation-httpx>=0.43b0; extra == "monitoring"
Requires-Dist: opentelemetry-exporter-otlp-proto-http<2,>=1.22; extra == "monitoring"
Requires-Dist: sentry-sdk[fastapi]<2,>=1.39; extra == "monitoring"
Requires-Dist: python-socketio<6,>=5.11; extra == "monitoring"
Requires-Dist: prometheus-client<1,>=0.19; extra == "monitoring"
Provides-Extra: all
Requires-Dist: psutil<6,>=5.9.6; extra == "all"
Requires-Dist: py-cpuinfo<10,>=9.0; extra == "all"
Requires-Dist: gputil<2,>=1.4; extra == "all"
Requires-Dist: wmi<2,>=1.5.1; platform_system == "Windows" and extra == "all"
Requires-Dist: pyjwt[crypto]<3,>=2.8; extra == "all"
Requires-Dist: passlib[bcrypt]<3,>=1.7.4; extra == "all"
Requires-Dist: python-jose[cryptography]<4,>=3.3; extra == "all"
Requires-Dist: python-multipart<1,>=0.0.6; extra == "all"
Requires-Dist: httpx<1,>=0.26; extra == "all"
Requires-Dist: slowapi<1,>=0.1.9; extra == "all"
Requires-Dist: asyncpg<1,>=0.29; extra == "all"
Requires-Dist: psycopg2-binary<3,>=2.9; extra == "all"
Requires-Dist: sqlalchemy[asyncio]<3,>=2.0.23; extra == "all"
Requires-Dist: alembic<2,>=1.13; extra == "all"
Requires-Dist: redis[hiredis]<6,>=5.0; extra == "all"
Requires-Dist: celery[redis]<6,>=5.3; extra == "all"
Requires-Dist: flower<3,>=2.0; extra == "all"
Requires-Dist: opentelemetry-api<2,>=1.22; extra == "all"
Requires-Dist: opentelemetry-sdk<2,>=1.22; extra == "all"
Requires-Dist: opentelemetry-instrumentation<1,>=0.43b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-fastapi<1,>=0.43b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-sqlalchemy<1,>=0.43b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-httpx<1,>=0.43b0; extra == "all"
Requires-Dist: opentelemetry-exporter-otlp-proto-http<2,>=1.22; extra == "all"
Requires-Dist: sentry-sdk[fastapi]<2,>=1.39; extra == "all"
Requires-Dist: python-socketio<6,>=5.11; extra == "all"
Requires-Dist: prometheus-client<1,>=0.19; extra == "all"
Dynamic: license-file

# Universal Dependency Resolver

Resolve dependencies across **PyPI (pip)**, **npm**, **Cargo**, **Go**, and more — detect conflicts, check system compatibility, and export to any format.

```
udr resolve numpy@pypi torch@pypi
  → numpy 1.26.2, torch 2.1.2+cu121 (CUDA 12.1)
```

## The Problem

Your project pulls in packages from everywhere — Python scripts call Node services, Docker images need both `pip` and `apt` packages, and your CI pipeline has to pin every transitive dependency across all of them.

Existing tools only work within one ecosystem. `pip-compile` handles Python. `npm ls` handles JavaScript. But cross-ecosystem conflicts go undetected until something breaks at runtime. And system compatibility — GPU drivers, CUDA versions, OS patches — is never checked at all.

This tool fixes that.

## Quick Start

```bash
pip install ud-resolver
```

Install with extras for additional features:
```bash
pip install "ud-resolver[system]"       # GPU & system scanning
pip install "ud-resolver[monitoring]"   # OpenTelemetry & Sentry
pip install "ud-resolver[security]"     # Auth & JWT support
pip install "ud-resolver[postgres]"     # PostgreSQL + Redis + Celery
pip install "ud-resolver[all]"          # Everything
```

## CLI Usage

```bash
# Start the API server
udr serve --port 8000

# Check system compatibility
udr check

# Resolve dependencies
udr resolve numpy pandas scikit-learn

# Resolve from other ecosystems
udr resolve react vue -e npm
udr resolve serde tokio -e crates

# Show system info
udr info

# Auto-detect manifests in project dir and lock all deps
udr lock

# Lock with explicit manifest
udr lock --manifest requirements.txt --manifest package.json

# Dry-run lock (no files written)
udr lock --dry-run

# Resolve with JSON output
udr resolve torch torchvision --format json
```

## Python Library Usage

```python
import asyncio
from backend.core.data_aggregator import DataAggregator
from backend.core.conflict_resolver import ConflictResolver
from backend.core.system_scanner import SystemScanner
from backend.manifest_detector import ManifestDetector

async def main():
    scanner = SystemScanner()
    system_info = await scanner.scan_all()
    print(system_info["platform"]["system"], system_info["cpu"]["brand"])

    aggregator = DataAggregator()
    data = await aggregator.get_package_info("torch", ecosystem="pypi",
                                              include_dependencies=True,
                                              include_versions=True)
    print(data["name"], data["versions"])

    detector = ManifestDetector("./my-project")
    manifests = detector.detect()
    packages = detector.normalize(detector.parse_all(manifests))
    print(f"{len(packages)} packages found")

asyncio.run(main())
```

## Features

| Feature | What it does |
|---------|--------------|
| **Multi-ecosystem** | PyPI (pip), npm, Cargo, Go, Conda, Maven, NuGet, RubyGems, Linux packages, Homebrew |
| **GPU-aware resolution** | Scans CUDA, cuDNN, GPU memory — resolves CUDA variants automatically |
| **System scan** | Detects OS, CPU, GPU, Python, Node.js, GCC, Java |
| **12 export formats** | Dockerfile, requirements.txt, package.json, docker-compose.yml, install.sh, install.bat, CMakeLists.txt, pyproject.toml, environment.yml, Cargo.toml, build.gradle, pom.xml |
| **CI/CD ready** | CLI for pipelines, health check endpoint, structured logging |

## API Quick Reference

| Endpoint | Method | Purpose |
|----------|--------|---------|
| `/api/v1/` | GET | API metadata |
| `/api/v1/health` | GET | Health check |
| `/api/v1/packages/search` | GET | Search across ecosystems |
| `/api/v1/packages/ecosystems` | GET | List supported ecosystems |
| `/api/v1/packages/{ecosystem}/{name}` | GET | Get package info |
| `/api/v1/packages/{ecosystem}/{name}/details` | GET | Rich package details with metrics |
| `/api/v1/packages/{ecosystem}/{name}/versions` | GET | List versions |
| `/api/v1/packages/{ecosystem}/{name}/dependencies` | GET | Get dependencies |
| `/api/v1/packages/{ecosystem}/{name}/compatibility` | GET | Compatibility info |
| `/api/v1/packages/{ecosystem}/{name}/compatibility/report` | POST | Submit compatibility report |
| `/api/v1/packages/compare` | GET | Compare packages |
| `/api/v1/packages/resolve` | POST | Resolve dependencies |
| `/api/v1/packages/export` | POST | Export to any format |
| `/api/v1/packages/export-formats` | GET | Available export formats |
| `/api/v1/system/info` | GET | System information |
| `/api/v1/system/check-compatibility` | POST | Check dependency-system fit |
| `/api/v1/system/gpu/info` | GET | GPU details |
| `/api/v1/system/runtime/{runtime}` | GET | Runtime version info |
| `/api/v1/system/analyze-environment` | POST | Analyze manifest file |
| `/api/v1/system/benchmarks` | GET | Run system benchmarks |
| `/api/v1/scan/github` | POST | Scan a GitHub repo |
| `/api/v1/scan/upload` | POST | Scan an uploaded archive |
| `/api/v1/scan/local` | POST | Scan a local directory |
| `/api/v1/auth/*` | * | Register, login, profile, API keys |

## How It Works

```
Your request → Fetch metadata from ecosystem registries
                   ↓
            Scan target system (OS, GPU, Python, CUDA)
                   ↓
            Resolve conflicts with SAT solver
                   ↓
            Export to 12 formats
```

The system runs as a FastAPI service with optional PostgreSQL and Redis.

## Also available

This package is the **backend component**. The project also ships:

- **Web UI** — a browser-based GUI (Vue.js), available as a Docker image or bundled in the desktop app
- **Desktop app** — standalone cross-platform application (Windows, macOS, Linux) with backend + frontend bundled, no Python or Node.js required

See the [full documentation](https://github.com/code-with-zeeshan/universal-dependency-resolver) for details.
