RESTful API proxy for Rez package manager
Project description
Rez Proxy
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 packagesGET /api/v1/packages/{name}- Get package detailsGET /api/v1/packages/{name}/versions- Get package versionsPOST /api/v1/packages/search- Search packages
Environment Operations
POST /api/v1/environments/resolve- Resolve environmentGET /api/v1/environments/{id}- Get environment detailsPOST /api/v1/environments/{id}/execute- Execute command in environmentDELETE /api/v1/environments/{id}- Delete environment
Suite Management
POST /api/v1/suites- Create new suiteGET /api/v1/suites- List all suitesGET /api/v1/suites/{id}- Get suite detailsPOST /api/v1/suites/{id}/contexts- Add context to suitePOST /api/v1/suites/{id}/tools/alias- Alias tool in suitePOST /api/v1/suites/{id}/save- Save suite to diskGET /api/v1/suites/{id}/tools- Get suite toolsDELETE /api/v1/suites/{id}- Delete suite
System Operations
GET /api/v1/system/status- Get system statusGET /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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
rez_proxy-1.2.0-py3-none-any.whl
(49.7 kB
view details)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cfa6cad05a168037cf6318e859eb8497682b30a386c08d43023e426ef7e091f
|
|
| MD5 |
b60289efdb8c58335771d604fd89ad2d
|
|
| BLAKE2b-256 |
5fca7f005e3e2977aa18d2610d235b6402f9a56fa191747186b5fca636ffb0f8
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eba25e97fb54db406f2e574c17fb70e14c5dabf8cb1b4e593c78bac85c17086d
|
|
| MD5 |
83e1f9200672dc5ea9e4873a877b76df
|
|
| BLAKE2b-256 |
2700c39215ffd124097e80f99526c97ae830befa2db32eb38ec6a41c247d6bed
|