Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .coveragerc

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/unit_tests_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ jobs:
${INSTALL_DIR:+--install-dir "$INSTALL_DIR"} \
--no-system --no-dev --no-base --no-task \
--src-deps megatron-lm \
--pip-deps typer \
--retry-count 3

# Copy test data (keep existing logic)
Expand Down
11 changes: 0 additions & 11 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
import os
import sys

# Add parent directory to path to import version
_parent_dir = os.path.dirname(os.path.abspath(__file__))
if _parent_dir not in sys.path:
sys.path.insert(0, _parent_dir)

from version import FLAGSCALE_VERSION

__version__ = FLAGSCALE_VERSION
27 changes: 27 additions & 0 deletions flagscale/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
def _get_version() -> str:
"""Get version from importlib.metadata or parse pyproject.toml as fallback."""
try:
from importlib.metadata import version

return version("flagscale")
except Exception:
pass

# Fallback: parse pyproject.toml for development mode (Python 3.11+)
try:
from pathlib import Path

import tomllib

pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
if pyproject_path.exists():
with open(pyproject_path, "rb") as f:
data = tomllib.load(f)
return data.get("project", {}).get("version", "0.0.0")
except Exception:
pass

return "0.0.0"


__version__ = _get_version()
Loading