# Contributing to VenvDrop

Thank you for your interest in contributing! VenvDrop is a pure-Python stdlib CLI tool, so the contribution bar is low — no external dependencies to manage.

---

## Development Setup

```bash
# 1. Clone the repo
git clone https://github.com/ashtharthasarathi/venvdrop.git
cd venvdrop

# 2. Install in editable mode (changes to core.py take effect immediately)
pip install -e .

# 3. Verify the CLI works
venvdrop --version
venvdrop --help
```

---

## Project Structure

```
venvdrop-project/
├── venvdrop/
│   ├── __init__.py   — version, author, exports main()
│   └── core.py       — all logic (zero external deps)
├── pyproject.toml    — package metadata + build config
├── README.md
├── CHANGELOG.md
├── CONTRIBUTING.md   — this file
├── LICENSE
├── MANIFEST.in
└── .gitignore
```

---

## Making Changes

All the logic lives in `venvdrop/core.py`. Key areas:

| Area | Location in core.py |
|------|---------------------|
| Constants (excluded dirs / exts) | Top of file |
| Colour / logging helpers | `info()`, `ok()`, `warn()`, `error()`, `fatal()` |
| Platform detection | `get_platform_meta()`, `check_platform_parity()` |
| AST scanner | `scan_for_absolute_paths()` |
| Venv-reuse (--from-venv) | `_get_pip_cache_dir()`, `_reuse_venv_wheels()` |
| Pack command | `cmd_pack()` |
| Unpack command | `cmd_unpack()` |
| CLI / argparse | `build_parser()`, `main()` |

---

## Testing Your Changes

```bash
# Smoke-test the CLI
venvdrop --version
venvdrop pack --help
venvdrop unpack --help

# Quick integration test (requires a requirements.txt in your test dir)
mkdir test_project && cd test_project
echo "requests" > requirements.txt
echo "print('hello')" > main.py
venvdrop pack -r requirements.txt -s . -o test_bundle.zip
venvdrop unpack -a test_bundle.zip -d ./deployed
```

---

## Releasing to PyPI

```bash
# Install build tools
pip install build twine

# Build sdist + wheel
python -m build

# Check the built distributions
twine check dist/*

# Upload to TestPyPI first (recommended)
twine upload --repository testpypi dist/*

# Upload to PyPI when ready
twine upload dist/*
```

---

## Code Style

- Follow PEP 8
- Use type hints on all new functions
- Keep functions focused — if it needs a docstring, write one
- Add a comment block header (`# ───...`) when adding a new logical section
- Zero runtime dependencies — do not import anything outside Python stdlib

---

## Reporting Issues

Open an issue at: https://github.com/ashtharthasarathi/venvdrop/issues

Please include:
- Your OS and Python version (`python --version`)
- The full command you ran
- The full error output
