Gravity

raw JSON →
1.2.1 verified Mon Apr 27 auth: no python

Command-line utilities to assist in managing Galaxy servers. Current version is 1.2.1, released on 2025-03-27. Release cadence is irregular, with multiple patch releases per year.

pip install gravity
error ModuleNotFoundError: No module named 'gravity'
cause Gravity is not installed or is installed in a different Python environment.
fix
pip install gravity
error GravityError: Must be root to run this command (set GRAVITY_SKIP_SYSTEMD=1 to bypass)
cause Gravity detected non-root user but systemd operations require root/sudo.
fix
Set environment variable GRAVITY_SKIP_SYSTEMD=1 if you are running without systemd or as non-root.
breaking Dropped support for Python 3.7 in v1.2.0
fix Use Python >=3.8
breaking Removed support for deprecated unicornherder in v1.2.0. Use gunicorn directly instead.
fix Configure gunicorn service directly; unicornherder flag no longer available.
deprecated Pydantic v1 syntax is deprecated in v1.2.1; use Pydantic v2 syntax.
fix Update any custom configuration models to Pydantic v2 style (e.g., Field(...) instead of deprecated methods).

Initialize GravityService with a Galaxy root directory and optional config path.

import os
from gravity import GravityService

# Initialize service manager
service = GravityService(
    galaxy_root='/opt/galaxy',
    config=os.environ.get('GRAVITY_CONFIG', 'config/galaxy.yml')
)

# Check status
print(service.status())