mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
Major Changes: - Complete package restructure with single-import API - Implemented 13 critical DAG algorithms - Version synchronization across all SDKs to v1.22.0 - C++ SDK complete implementation (250+ lines) Core Implementations: - DAG Horizon: 8 algorithms (IsReachable, LCA, ComputeSafePrefix, ChooseFrontier, Antichain, Horizon, ComputeHorizonOrder, BeyondHorizon) - DAG Flare: 3 functions (HasCertificateGeneric, HasSkipGeneric, UpdateDAGFrontier) - C++ Chain: Complete FFI-based implementation with serialization API Simplification: - Before: Deep nested imports, 10+ config parameters, complex factories - After: Single import "github.com/luxfi/consensus", auto-configuration Version Updates: - Go: version/version.go → 1.22.0 - Python: pkg/python/setup.py → 1.22.0 - Rust: pkg/rust/Cargo.toml → 1.22.0 - C: pkg/c/include/lux_consensus.h → 1.22.0 - C++: New implementation with v1.22.0 API Documentation: - Added MIGRATION_v1.22.md (6.9KB migration guide) - Added RELEASE_v1.22.0.md (7.6KB release notes) - Updated README.md with v1.22.0 examples - Updated LLM.md with complete changelog Test Results: - Go: 96 packages tested, 0 failures - Python: 4/4 tests passing - Rust: 4/4 tests passing - Node integration: verified Breaking Changes: See MIGRATION_v1.22.md for complete migration instructions. Status: PRODUCTION READY All critical algorithms implemented, zero test failures, comprehensive documentation.
58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
# Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
# See the file LICENSE for licensing terms.
|
|
|
|
from setuptools import setup, Extension
|
|
from Cython.Build import cythonize
|
|
import os
|
|
import sys
|
|
import platform
|
|
|
|
# Path to the C library
|
|
c_lib_path = os.path.join(os.path.dirname(__file__), '..', 'c')
|
|
include_dirs = [os.path.join(c_lib_path, 'include')]
|
|
library_dirs = [os.path.join(c_lib_path, 'lib')]
|
|
|
|
# Platform-specific settings
|
|
extra_link_args = []
|
|
if platform.system() == 'Darwin':
|
|
# macOS specific settings
|
|
extra_link_args = ['-Wl,-rpath,@loader_path/../c/lib']
|
|
elif platform.system() == 'Linux':
|
|
# Linux specific settings
|
|
extra_link_args = ['-Wl,-rpath,$ORIGIN/../c/lib']
|
|
|
|
extensions = [
|
|
Extension(
|
|
"lux_consensus",
|
|
["lux_consensus.pyx"],
|
|
include_dirs=include_dirs,
|
|
library_dirs=library_dirs,
|
|
libraries=["luxconsensus"],
|
|
extra_link_args=extra_link_args,
|
|
language="c",
|
|
)
|
|
]
|
|
|
|
setup(
|
|
name="lux-consensus",
|
|
version="1.22.0",
|
|
description="Python bindings for Lux Consensus C library with optional MLX GPU acceleration",
|
|
author="Lux Industries Inc.",
|
|
packages=["lux_consensus"],
|
|
ext_modules=cythonize(extensions, language_level="3"),
|
|
install_requires=[
|
|
"numpy>=1.20.0",
|
|
],
|
|
extras_require={
|
|
"mlx": [
|
|
"mlx>=0.0.1", # Apple Silicon GPU acceleration
|
|
],
|
|
"dev": [
|
|
"pytest>=7.0.0",
|
|
"pytest-benchmark>=4.0.0",
|
|
],
|
|
},
|
|
zip_safe=False,
|
|
python_requires=">=3.8",
|
|
) |