Remove Python 2 compatibility code#1442
Conversation
Remove all remaining Python 2 compatibility imports and shebangs: - Remove __future__ imports (print_function, absolute_import, division) - Update shebang in libmount_deb.py from python to python3 - Remove obsolete Python 2/3 compatibility comments These are no longer needed as blivet is Python 3 only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
WalkthroughThis pull request removes Python 2 compatibility code across multiple files. Changes include removal of future imports (absolute_import, print_function, division) and updates to the Python 3 shebang, reflecting a migration away from Python 2 support. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
blivet/arch.py(0 hunks)misc/files/libmount_deb.py(1 hunks)tests/run_tests.py(0 hunks)tests/unit_tests/size_test.py(0 hunks)
💤 Files with no reviewable changes (3)
- tests/run_tests.py
- tests/unit_tests/size_test.py
- blivet/arch.py
🧰 Additional context used
🪛 Ruff (0.14.7)
misc/files/libmount_deb.py
1-1: Shebang is present but file is not executable
(EXE001)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: static-analysis
- GitHub Check: unit-tests
🔇 Additional comments (1)
misc/files/libmount_deb.py (1)
1-120: Python 3 migration looks good.The removal of Python 2 compatibility code is appropriate and complete. The script correctly uses Python 3 features throughout (native
print()function with keyword arguments, proper bytes/string handling with.decode()).
| @@ -1,11 +1,9 @@ | |||
| #!/usr/bin/python | |||
| #!/usr/bin/python3 | |||
There was a problem hiding this comment.
Make the file executable.
The shebang update to Python 3 is correct. However, files with shebangs should typically be executable.
Apply this command to fix the file permissions:
chmod +x misc/files/libmount_deb.py🧰 Tools
🪛 Ruff (0.14.7)
1-1: Shebang is present but file is not executable
(EXE001)
🤖 Prompt for AI Agents
In misc/files/libmount_deb.py around line 1, the file has a Python3 shebang but
is not executable; fix it by setting the executable permission on the file (make
it runnable by the owner, e.g., run chmod +x on misc/files/libmount_deb.py) so
the shebang is respected when executed.
Remove all remaining Python 2 compatibility imports and shebangs:
These are no longer needed as blivet is Python 3 only.
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.