# Publishing the ABM Framework to PyPI

## Step 1: Complete Package Metadata

First, update `pyproject.toml` with complete information.

## Step 2: Create Required Files

You need:
- `README.md` - Project description (already exists)
- `LICENSE` - Choose a license (MIT, Apache 2.0, etc.)
- `MANIFEST.in` - Include non-Python files
- `.gitignore` - Exclude build artifacts

## Step 3: Install Build Tools

```bash
pip install build twine
```

## Step 4: Build the Package

```bash
# From project root
python -m build
```

This creates:
- `dist/abm_framework-0.1.0-py3-none-any.whl` (wheel)
- `dist/abm-framework-0.1.0.tar.gz` (source distribution)

## Step 5: Test on TestPyPI (Recommended)

```bash
# Create account at https://test.pypi.org

# Upload to TestPyPI
python -m twine upload --repository testpypi dist/*

# Test installation
pip install --index-url https://test.pypi.org/simple/ abm-framework
```

## Step 6: Publish to PyPI

```bash
# Create account at https://pypi.org

# Upload to PyPI
python -m twine upload dist/*
```

## Step 7: Install Your Package

After publishing, anyone can:

```bash
pip install abm-framework
```

## Step 8: Create GitHub Releases

Tag versions in git:

```bash
git tag -a v0.1.0 -m "First release"
git push origin v0.1.0
```

## Important Notes

1. **Package Name**: Currently `abm-framework` - check if available on PyPI first
2. **Version**: Start with `0.1.0` for initial release
3. **Semantic Versioning**: Use MAJOR.MINOR.PATCH (e.g., 1.2.3)
4. **License**: Choose one (MIT is common for open source)
5. **Documentation**: Consider hosting docs on Read the Docs

## Updating the Package

When making updates:

1. Update version in `pyproject.toml`
2. Update `CHANGELOG.md` with changes
3. Rebuild: `python -m build`
4. Upload: `python -m twine upload dist/*`

## Best Practices

- Always test on TestPyPI first
- Use API tokens instead of passwords for uploading
- Keep a CHANGELOG.md documenting changes
- Write comprehensive documentation
- Include examples and demos
