This guide explains how to build and distribute the JEPA package.
Make sure you have the latest versions of build tools:
pip install --upgrade pip build twineFor development and testing:
# Install in editable mode
pip install -e .
# Or run the development setup script
./install_dev.shBuild both wheel and source distributions:
# Clean previous builds
rm -rf build/ dist/ *.egg-info/
# Build the package
python -m build
# This creates:
# - dist/jepa-0.1.0.tar.gz (source distribution)
# - dist/jepa-0.1.0-py3-none-any.whl (wheel distribution)Check the built package:
# Check package contents
tar -tzf dist/jepa-0.1.0.tar.gz
# Test installation from wheel
pip install dist/jepa-0.1.0-py3-none-any.whl
# Verify installation
python verify_install.py# Install in a fresh virtual environment
python -m venv test_env
source test_env/bin/activate
pip install dist/jepa-0.1.0-py3-none-any.whl
# Test basic functionality
python -c "import jepa; print(jepa.__version__)"
jepa-train --helpUpload to TestPyPI for testing:
# Upload to TestPyPI
twine upload --repository testpypi dist/*
# Install from TestPyPI
pip install --index-url https://test.pypi.org/simple/ jepaBefore publishing, ensure:
- All tests pass:
pytest - Version is correct in
jepa/__init__.py - CHANGELOG.md is updated
- Documentation is up to date
# Upload to PyPI (requires PyPI account and API token)
twine upload dist/*Once published, users can install with:
pip install jepaThe package includes:
jepa/
├── __init__.py # Main package interface
├── models/ # Model implementations
├── trainer/ # Training framework
├── config/ # Configuration management
├── data/ # Data utilities
├── loggers/ # Logging system
├── cli/ # Command line interface
└── py.typed # Type hint marker
pyproject.toml- Modern Python packaging configurationsetup.py- Backward compatibility setup scriptMANIFEST.in- Additional files to includerequirements.txt- Runtime dependenciespy.typed- Indicates this is a typed package
The package provides these CLI commands:
jepa-train- Train JEPA modelsjepa-evaluate- Evaluate trained models
- Make changes to the code
- Update version in
jepa/__init__.py - Run tests:
pytest - Update documentation if needed
- Build package:
python -m build - Test locally:
pip install dist/jepa-*.whl - Upload to PyPI:
twine upload dist/*
- Import errors: Ensure all
__init__.pyfiles are properly configured - Missing dependencies: Check
requirements.txtandpyproject.toml - CLI commands not found: Verify entry points in
pyproject.toml - Type checking issues: Ensure
py.typedfile is included
# Check package metadata
python setup.py check
# List package contents
python -c "import jepa; print(jepa.__file__)"
# Check entry points
pip show -f jepa
# Uninstall for clean testing
pip uninstall jepa -y