Repository: explodinggradients/ragas
Issue: `make install` fails due to incompatible dependency configuration
Root cause: Configuration Error

[x] I have checked the [documentation](https://docs.ragas.io/) and related resources and couldn't resolve my bug.

---

## Description

The current development setup has an incompatibility between the root Makefile and `ragas/pyproject.toml` that prevents contributors from setting up the development environment as documented.

### Current Behavior

Running `make install` fails with:
```bash
$ make install
Installing dependencies...
Installing ragas dependencies (including experimental)...
...
warning: The package `ragas @ file:///home/max/ragas/ragas` does not have an extra named `dev`
Setting up pre-commit hooks...
make: pre-commit: No such file or directory
make: *** [Makefile:21: install] Error 127
```

### Environment
- OS: MX Linux 23
- Python: 3.11.2
- uv version: 0.8.11
- (RAGAS version /) Repository commit: f16676764 (main branch)

### Root Cause

1. **Dependency format mismatch**: The root Makefile attempts to install using extras syntax:
   ```makefile
   $(Q)uv pip install -e "./ragas[dev]"
   ```
   However, `ragas/pyproject.toml` defines dev dependencies using `[dependency-groups]` (PEP 735) instead of `[project.optional-dependencies]`, so there is no `dev` extra available. This means `pre-commit` is never installed, causing the hook setup to fail.

2. **Directory structure issue**: When using `uv pip install --group dev`, uv expects a `pyproject.toml` in the current working directory, but in the ragas repository structure, it's located at `ragas/pyproject.toml`. The root Makefile needs to either use `--directory ragas` or `cd ragas` to access it.

## Steps to Reproduce

1. Clone the repository
2. Install uv: `curl -LsSf https://astral.sh/uv/install.sh | sh` 
3. Create venv: `uv venv`
4. Activate: `source .venv/bin/activate`
5. Run `make install`
6. Observe the error

## Expected Behavior

`make install` should successfully install all necessary development dependencies and set up pre-commit hooks.

## Potential Solutions

### Option 1: Use dependency-groups with correct directory (leads to excessive downloads)
```makefile
$(Q)uv pip install -e "./ragas"
$(Q)cd ragas && uv pip install --group dev
# OR: $(Q)uv pip install --directory ragas --group dev
```

**Problem**: This installs 236+ packages including PyTorch, CUDA libraries (~1.5GB download) because the dev group includes:
```toml
"ragas[all,tracing,gdrive,ai-frameworks]"
```
This might be excessive for contributors who just want to run tests, format code, and submit PRs?

### Option 2: Convert to project.optional-dependencies
Move from `[dependency-groups]` to `[project.optional-dependencies]` in `ragas/pyproject.toml`:
```toml
[project.optional-dependencies]
dev = [
    "ruff",
    "pyright>=1.1.403",
    "pre-commit>=4.3.0",
    "pytest",
    "pytest-xdist[psutil]",
    "pytest-asyncio",
    "nbmake",
    "notebook",
    # NOT including "ragas[all,...]" to keep it minimal
]
```

Then the Makefile can use:
```makefile
$(Q)uv pip install -e "./ragas[dev]"
```

### Option 3: Separate minimal and full dev installations (Recommended)
Create two installation targets - one for basic development needs, one for full ML stack:

```makefile
install: ## Install minimal dev dependencies for contributing
	@echo "Installing ragas core..."
	$(Q)uv pip install -e "./ragas"
	@echo "Installing essential dev tools..."
	$(Q)uv pip install pre-commit ruff pyright pytest pytest-xdist pytest-asyncio nbmake
	@echo "Setting up pre-commit hooks..."
	$(Q)uv run pre-commit install
	@echo "Installation complete! (minimal dev environment)"

install-full: ## Install ALL dependencies including ML frameworks (~1.5GB)
	@echo "Installing ragas core..."
	$(Q)uv pip install -e "./ragas"
	@echo "Installing ALL dev dependencies (includes ML frameworks)..."
	$(Q)cd ragas && uv pip install --group dev
	@echo "Setting up pre-commit hooks..."
	$(Q)uv run pre-commit install
	@echo "Full installation complete!"
```

### Option 4: Hybrid with both dependency formats
Maintain both formats for different use cases:
```toml
[project.optional-dependencies]
dev = [  # Minimal dev requirements
    "ruff",
    "pyright>=1.1.403",
    "pre-commit>=4.3.0",
    "pytest",
    "pytest-xdist[psutil]",
    "pytest-asyncio",
    "nbmake",
]

[dependency-groups]
dev-full = [  # Everything including ML stack
    "ragas[all,tracing,gdrive,ai-frameworks]",
    # ... other heavy dependencies
]
```

## Questions

Which option would you prefer? Do all contributors immediatelly need full heavy ML stacks?




## Additional Context

The DEVELOPMENT.md instructs users to run `make install`, but this currently doesn't work out of the box. This is a barrier for new contributors wanting to help with the project. The fix should ensure a smooth onboarding experience while keeping the option for full installations when needed.

See #2164 



@aicodexp if you can contribute option 4, that'd be great. 

@aicodexp feel free to refer the linked PR on how I am thinking about this. Will most likely not merge that PR, it's just something I wanted to try and see since I suggested Option 4 here earlier 

Damn, these bloated dev deps means Github CI format check can take >5min to install deps: https://github.com/explodinggradients/ragas/actions/runs/17102612343/job/48503061074?pr=2205

@aicodexp we discussed this with more contributors and polished it in the PR which is merged now. What do you think? Does this solve your use cases?