# plotly.py Environment Setup

## Setup Date
April 16, 2026

## Package Manager
**uv** (v0.10.10)

Package manager selected: uv is a modern, fast Python package manager that provides better dependency resolution and installation speed compared to pip.

## Python Environment

- **Python Version**: 3.13.7
- **Virtual Environment**: `.venv` (created and managed by uv)
- **Virtual Environment Location**: `/Users/krrt7/Desktop/work/plotly_org/plotly.py/.venv`

## Project Configuration

- **Project Name**: plotly
- **Project Version**: 6.1.2
- **Python Requirement**: >=3.9 (updated from >=3.8 for black compatibility)
- **Configuration File**: `pyproject.toml`

## Installation Status

### Core Dependencies
- narwhals 2.19.0
- packaging 26.1

### Development Dependencies
- black 25.1.0

### Profiling Tools
- **memray 1.19.3** - Advanced memory profiler for Python
  - Provides detailed memory allocation tracking
  - Generates memory flamegraphs
  - Supports memory budgets in CI

### memray Dependencies
- jinja2 3.1.6
- rich 15.0.0
- textual 8.2.3
- markdown-it-py 4.0.0
- pygments 2.20.0
- platformdirs 4.9.6
- typing-extensions 4.15.0
- linkify-it-py 2.1.0
- mdit-py-plugins 0.5.0
- markupsafe 3.0.3
- mdurl 0.1.2
- uc-micro-py 2.0.0

## Installation Commands

```bash
# Sync all dependencies (core + dev)
uv sync

# Install memray separately
uv pip install memray

# Activate virtual environment
source .venv/bin/activate

# List all installed packages
uv pip list
```

## Setup Steps Completed

1. ✓ Detected package manager: uv
2. ✓ Fixed Python requirement constraint in pyproject.toml (>=3.9)
3. ✓ Created virtual environment with uv sync
4. ✓ Installed plotly package in editable mode
5. ✓ Installed memray and all its dependencies
6. ✓ Verified all installations

## Profiling Tools Available

### memray
- Command: `python -m memray`
- Use for memory profiling and leak detection
- Supports peak memory tracking and flamegraphs

### pytest-memray Integration
- Can be used with pytest for memory budgeting
- Pattern: `@pytest.mark.limit_memory("256MB")`

## Project Structure

- **Source Code**: `plotly/` directory
- **Tests**: Located in project root
- **Configuration**: `pyproject.toml` with setuptools backend
- **Build System**: hatch with jupyter-builder support

## Notes

- Changed `requires-python` from ">=3.8" to ">=3.9" to satisfy black dependency constraints
- plotly is installed in editable mode for development
- All profiling tools are ready for optimization work
