Skip to main content

RESTful API proxy for Rez package manager

Project description

Rez Proxy

PyPI version Python Support License Tests Release codecov Downloads

A RESTful API proxy for Rez package manager, built with FastAPI.

中文文档

Features

  • 🚀 RESTful API: Complete REST interface for Rez operations
  • 📦 Package Management: Search, query, and manage Rez packages
  • 🔍 Environment Resolution: Resolve and create Rez environments
  • 🌐 TypeScript Ready: Perfect for TypeScript/JavaScript integration
  • Fast: Built with FastAPI for high performance
  • 🐍 Easy Deployment: Deploy with uvx rez-proxy
  • 🔧 Configurable: Flexible configuration via environment variables
  • 📚 Auto-Generated Docs: Interactive API documentation with Swagger UI
  • 🔄 Versioned API: Support for API versioning with backward compatibility

Quick Start

Installation

# Install via pip
pip install rez-proxy

# Or install via uvx (recommended)
uvx install rez-proxy

Usage

# Start the server
uvx rez-proxy

# Or with custom configuration
uvx rez-proxy --host 0.0.0.0 --port 8080

# With custom API paths
REZ_PROXY_API_DOCS_URL=/documentation uvx rez-proxy

The API will be available at:

  • API Base: http://localhost:8000/api/v1
  • Documentation: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc
  • API Info: http://localhost:8000/api/info

API Endpoints

Package Operations

  • GET /api/v1/packages - List all packages
  • GET /api/v1/packages/{name} - Get package details
  • GET /api/v1/packages/{name}/versions - Get package versions
  • POST /api/v1/packages/search - Search packages

Environment Operations

  • POST /api/v1/environments/resolve - Resolve environment
  • GET /api/v1/environments/{id} - Get environment details
  • POST /api/v1/environments/{id}/execute - Execute command in environment
  • DELETE /api/v1/environments/{id} - Delete environment

Suite Management

  • POST /api/v1/suites - Create new suite
  • GET /api/v1/suites - List all suites
  • GET /api/v1/suites/{id} - Get suite details
  • POST /api/v1/suites/{id}/contexts - Add context to suite
  • POST /api/v1/suites/{id}/tools/alias - Alias tool in suite
  • POST /api/v1/suites/{id}/save - Save suite to disk
  • GET /api/v1/suites/{id}/tools - Get suite tools
  • DELETE /api/v1/suites/{id} - Delete suite

System Operations

  • GET /api/v1/system/status - Get system status
  • GET /api/v1/system/config - Get Rez configuration

Configuration

The server can be configured via environment variables or command line arguments:

Server Configuration

# Basic server settings
export REZ_PROXY_API_HOST=0.0.0.0
export REZ_PROXY_API_PORT=8080
export REZ_PROXY_API_LOG_LEVEL=info
export REZ_PROXY_API_WORKERS=4

# API paths (customize documentation URLs)
export REZ_PROXY_API_API_PREFIX=/api/v1
export REZ_PROXY_API_DOCS_URL=/docs
export REZ_PROXY_API_REDOC_URL=/redoc

# Command line
uvx rez-proxy --host 0.0.0.0 --port 8080 --log-level debug

Rez Configuration

# Rez-specific settings
export REZ_PROXY_API_REZ_CONFIG_FILE=/path/to/rezconfig.py
export REZ_PROXY_API_REZ_PACKAGES_PATH=/path/to/packages
export REZ_PROXY_API_REZ_LOCAL_PACKAGES_PATH=/path/to/local/packages
export REZ_PROXY_API_REZ_RELEASE_PACKAGES_PATH=/path/to/release/packages

# Cache settings
export REZ_PROXY_API_ENABLE_CACHE=true
export REZ_PROXY_API_CACHE_TTL=300

Development

Prerequisites

  • Python 3.10+
  • Rez package manager
  • uv (recommended) or pip

Setup

# Clone the repository
git clone https://github.com/loonghao/rez-proxy.git
cd rez-proxy

# Install dependencies
uvx nox -s dev

# Run tests
uvx nox -s pytest

# Start development server
uvx nox -s serve

Testing

# Run all tests
uvx nox -s pytest

# Run with coverage
uvx nox -s pytest -- --cov

# Run specific tests
uvx nox -s pytest -- tests/test_api.py

TypeScript Integration

import axios from 'axios';

const rezApi = axios.create({
  baseURL: 'http://localhost:8000/api/v1'
});

// Search packages
const packages = await rezApi.post('/packages/search', {
  query: 'python',
  limit: 10
});

// Resolve environment
const environment = await rezApi.post('/environments/resolve', {
  packages: ['python-3.9', 'requests']
});

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Rez - The amazing package manager
  • FastAPI - The web framework used
  • uv - Fast Python package installer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rez_proxy-1.2.0.tar.gz (72.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rez_proxy-1.2.0-py3-none-any.whl (49.7 kB view details)

Uploaded Python 3

File details

Details for the file rez_proxy-1.2.0.tar.gz.

File metadata

  • Download URL: rez_proxy-1.2.0.tar.gz
  • Upload date:
  • Size: 72.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.11

File hashes

Hashes for rez_proxy-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0cfa6cad05a168037cf6318e859eb8497682b30a386c08d43023e426ef7e091f
MD5 b60289efdb8c58335771d604fd89ad2d
BLAKE2b-256 5fca7f005e3e2977aa18d2610d235b6402f9a56fa191747186b5fca636ffb0f8

See more details on using hashes here.

File details

Details for the file rez_proxy-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: rez_proxy-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 49.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.11

File hashes

Hashes for rez_proxy-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eba25e97fb54db406f2e574c17fb70e14c5dabf8cb1b4e593c78bac85c17086d
MD5 83e1f9200672dc5ea9e4873a877b76df
BLAKE2b-256 2700c39215ffd124097e80f99526c97ae830befa2db32eb38ec6a41c247d6bed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page