Fix: PEP 440 Version Format in Release Workflow#16
Merged
Conversation
- Created setup.py with dynamic version generation from git commit - Fixed version format from invalid '2026.02.21-e713ca2' to compliant '2026.2.21.dev0+commit' - Added robust error handling for git operations - Successfully builds both source distribution (.tar.gz) and wheel (.whl) - Resolves CI/CD pipeline packaging failures - Supports console script entry point for 'powertrader' command
- Remove hardcoded 'robinhood' default from pt_hub.py primary_exchange - Add handling for empty primary_exchange to prevent credential errors - Set US region default exchanges to disabled instead of enabling robinhood - Prevents CI failures when GitHub secrets/credentials aren't configured - Allows graceful operation without requiring immediate exchange setup - Resolves integration test failures in CI/CD pipeline
- Move credential loading from import-time to runtime in pt_trader.py - Replace SystemExit(1) with graceful error handling - Add POWERTRADER_ENV=test check to skip credentials in CI - Credentials now loaded only when CryptoAPITrading class is instantiated - Prevents build failures when GitHub secrets/credentials aren't configured - Allows basic import testing without requiring exchange credentials This follows proper CI/CD practices where builds shouldn't need external credentials
- Make KuCoin client imports optional in pt_thinker.py and pt_trainer.py - Skip KuCoin initialization in POWERTRADER_ENV=test environments - Add proper error handling for when market client is unavailable - Move pt_thinker initialization from import-time to main block - Prevents CI/CD failures from pkg_resources dependency issues in kucoin-python Key changes: - Conditional KuCoin imports with graceful fallback - Import-time network calls moved to runtime only - Compatible with Python 3.13+ where pkg_resources was deprecated - Maintains full functionality in production environments
…tion - Add DataProvider abstraction layer to decouple core modules from specific exchanges - Create comprehensive exchange configuration with 66+ platforms across: * Centralized exchanges (28): Tier 1/2 + regional (Rain, Yellow Card, Quidax, VALR) * DeFi/DEX platforms (18): Ethereum, Layer2, lending, staking protocols * Derivatives (7): perpetuals, options, synthetics * Specialized platforms (8): prediction markets, P2P, NFT/gaming * Cross-chain infrastructure (5): bridges and aggregators - Update pt_thinker.py and pt_trainer.py to use provider interface - Enable regional exchange optimization (US/EU/Asia/Africa-MENA priorities) - Implement intelligent fallback strategies across entire ecosystem - Restore user choice in exchange selection vs KuCoin lock-in Resolves architectural issue where sophisticated multi-exchange system was bypassed by hardcoded dependencies in core prediction modules.
- Changed version format from '2026.02.22-b7f563a' to PEP 440 compliant '2026.02.22+b7f563a' - Added separate PYTHON_VERSION output for packaging compatibility - Fixes InvalidVersion error: 'Invalid version: 2026.02.22-b7f563a' in setup.py - Uses '+' for local version identifier instead of '-' as per PEP 440
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Bug Fix: Python Packaging Version Compliance
Issue Resolved
Fixes the Code Release & Distribution workflow failure caused by invalid Python version format.
Error Fixed:
Changes Made
2026.02.22-b7f563ato PEP 440 compliant2026.02.22+b7f563aPYTHON_VERSIONoutput for Python packaging compatibility+for local version identifier instead of-as required by Python packaging standardsTechnical Details
+not-per PEP 440Testing
Impact