Skip to content

feat: Add Python packaging support for pip installation - #26

Open
yurekami wants to merge 1 commit into
deepseek-ai:mainfrom
yurekami:feat/add-packaging-support
Open

yurekami wants to merge 1 commit into
deepseek-ai:mainfrom
yurekami:feat/add-packaging-support

Conversation

@yurekami

Copy link
Copy Markdown

Summary

  • Adds pyproject.toml for modern Python packaging (PEP 517/518)
  • Adds module docstring and __version__ for better API
  • Expands __all__ to export additional utility functions

Motivation

Currently, users must manually copy eplb.py to use this library. With proper packaging support, users can:

# Install from GitHub
pip install git+https://github.com/deepseek-ai/EPLB.git

# Or install for local development
git clone https://github.com/deepseek-ai/EPLB.git
cd EPLB
pip install -e .

Then use it in their code:

import eplb
print(eplb.__version__)  # "1.0.0"

phy2log, log2phy, logcnt = eplb.rebalance_experts(weight, num_replicas, num_groups, num_nodes, num_gpus)

Changes

New file: pyproject.toml

  • Modern build system configuration (setuptools backend)
  • Package metadata (name, version, description, authors)
  • Python version requirement (>=3.8)
  • PyTorch dependency (>=1.10.0)
  • PyPI classifiers for discoverability

Modified: eplb.py

  • Added module-level docstring
  • Added __version__ = "1.0.0"
  • Expanded __all__ to include:
    • __version__
    • rebalance_experts (main entry point)
    • rebalance_experts_hierarchical (hierarchical policy)
    • balanced_packing (utility for bin packing)
    • replicate_experts (utility for expert replication)

Test plan

  • Verify pyproject.toml is valid
  • Verify Python syntax is correct
  • Test pip install -e . works locally
  • Test import and basic usage

🤖 Generated with Claude Code

Add proper Python packaging support to enable pip installation:
- Add pyproject.toml with modern build system configuration
- Add module docstring describing the package
- Add __version__ = "1.0.0" for version tracking
- Expand __all__ to export additional utility functions

This enables users to install the package via:
  pip install git+https://github.com/deepseek-ai/EPLB.git

Or for local development:
  pip install -e .

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant