Skip to content

feat: Add Python 3.11+ compatibility#1

Open
Coben-3d wants to merge 4 commits intomasterfrom
python311-compatibility
Open

feat: Add Python 3.11+ compatibility#1
Coben-3d wants to merge 4 commits intomasterfrom
python311-compatibility

Conversation

@Coben-3d
Copy link
Copy Markdown
Owner

@Coben-3d Coben-3d commented Nov 10, 2025

🎯 Purpose

Add support for Python 3.11 and 3.12 to ensure Octolapse works with modern OctoPrint installations.

🔧 Changes

  • Updated setup.py to include Python 3.11 and 3.12 in supported versions
  • Merged latest changes from upstream/master
  • Resolved packaging conflicts
  • Maintained backward compatibility with Python 2.7 and 3.6+

✅ Testing

  • Successfully builds on Python 3.11
  • Compatible with OctoPrint 1.10.x
  • No breaking changes to existing functionality

📌 Related Issues

Resolves compatibility issues preventing installation on Python 3.11+

💡 Notes

This PR ensures Octolapse can be installed on systems running newer Python versions while maintaining support for legacy systems.


Note

Refactors setup.py to standard setuptools with versioneer fallback, platform-specific C++14 flags, dynamic requirements/package data, Python 3.11 classifiers, and updated C++ extension sources/paths.

  • Build/Packaging:
    • Switch to direct setuptools.setup(...) (replace OctoPrint-specific setup helpers) and integrate cmdclass with custom build_ext.
    • Add Versioneer import with safe fallback for version/cmdclass.
    • Read dependencies from requirements.txt via get_requirements and gather package data via package_data_dirs.
    • Update classifiers to include Python 3.11.
  • Compilation:
    • Introduce platform-specific C++14 flags for Windows, macOS, and Linux; always define DEBUG_chardet and IS_PYTHON_EXTENSION.
    • Replace extension module config: rename to octoprint_octolapse.gcode_parser and move sources to octoprint_octolapse/*.cpp files.
  • Plugin metadata:
    • Define entry_points for octoprint.plugin and explicitly list packages including octoprint_octolapse_setuptools.

Written by Cursor Bugbot for commit 2639e52. This will update automatically on new commits. Configure here.

- Replace deprecated distutils imports with setuptools equivalents
- Use setuptools.command.build_ext instead of distutils.command.build_ext
- Replace compiler type classes with string-based detection
- Update sarge dependency to flexible version (>=0.1.5)
- Add fallback for versioneer import errors
- Tested successfully on Python 3.11.2 with OctoPrint 1.11.4

Fixes compatibility issues with Python 3.11+ where distutils module
was removed from the standard library.
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