Skip to content

Add Python 3.13 Support and Fix Test Hanging Issues #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Vectorrent
Copy link
Contributor

This pull request adds official support for Python 3.13 to the Hivemind project and fixes test hanging issues.

Changes

  1. Fixed Python 3.13 deprecation warnings:

    • Replaced datetime.utcnow() with datetime.now(timezone.utc) in tests/test_auth.py
    • Replaced deprecated pkg_resources with modern alternatives:
      • Used Path-based approach instead of resource_filename in tests/test_utils/p2p_daemon.py
      • Replaced parse_requirements with direct file reading in setup.py
      • Replaced parse_version with packaging.version.parse in setup.py
  2. Updated version support:

    • Added Python 3.13 to the list of supported versions in setup.py classifiers
    • Added Python 3.13 to the GitHub Actions test matrix in .github/workflows/run-tests.yml
  3. Fixed test hanging issues in test_averaging.py:

    • Added proper try-finally blocks for resource cleanup
    • Added pytest timeout markers to critical tests
    • Improved timing logic and increased timeouts for stability
    • Fixed indentation issues that were causing test failures

Testing

  • All tests pass on Python 3.13.3, including the previously hanging test_averaging.py
  • No Python 3.13-specific errors were found
  • Backward compatibility maintained with Python 3.9-3.12

Notes

  • The bitsandbytes dependency works correctly with Python 3.13
  • All changes are backward compatible and don't break existing functionality

Copy link

codecov bot commented May 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.35%. Comparing base (d20e810) to head (d6a8fd3).
Report is 24 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #656      +/-   ##
==========================================
- Coverage   85.39%   85.35%   -0.04%     
==========================================
  Files          81       96      +15     
  Lines        8006     8592     +586     
==========================================
+ Hits         6837     7334     +497     
- Misses       1169     1258      +89     
Files with missing lines Coverage Δ
hivemind/averaging/averager.py 90.34% <100.00%> (+2.24%) ⬆️

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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