pairtools
pairtools copied to clipboard
Deprecation of `pipes` Module in Python 3.13 in `pairtools/lib/fileio.py`
In Python 3.13, the pipes module is deprecated and will be removed in future versions of Python. The current implementation in the pairtools/lib/fileio.py file relies on the pipes module, which triggers a DeprecationWarning when running the code on Python 3.13 or higher.
This issue tracks the necessary refactor to remove the use of the pipes module and ensure compatibility with future Python releases.
Affected File:
pairtools/lib/fileio.py
Problem:
The code in pairtools/lib/fileio.py uses the deprecated pipes module. Python's DeprecationWarning indicates that this module will be removed in Python 3.13, which could cause compatibility issues for users who upgrade to newer Python versions.
Example Warning:
When running the code on Python 3.13 or higher, the following warning is triggered:
DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
import pipes
Proposed Solution:
- Refactor the
pairtools/lib/fileio.pycode to eliminate the use of thepipesmodule. - Replace
pipes-based functionality with a more modern alternative, such as thesubprocessmodule, which is the recommended way to interact with system processes in Python. - Ensure that the new implementation preserves the original behavior and functionality of the code.
Impact:
- The removal of
pipeswill ensure that pairtools remains compatible with Python 3.13 and beyond. - Users running Python 3.13 or later will no longer see the DeprecationWarning related to the
pipesmodule.
Additional Notes:
- This change will help future-proof the code against Python 3.13+ by removing reliance on deprecated features.
- Testing will be required after the refactor to verify that the changes do not affect the functionality or performance of the software.
Action Items:
- Identify all occurrences of
pipesinpairtools/lib/fileio.py. - Refactor the code to replace
pipeswith alternatives (e.g.,subprocessor other suitable methods). - Test the refactored code to ensure that it works as expected and does not trigger DeprecationWarnings.
- Document the change and update any relevant documentation or comments in the code.
This issue ensures that pairtools is prepared for future Python versions by addressing the deprecation of the pipes module.
@nvictus Hello. I'm refactoring auto_open function right now. Can you make me assignee, i'll commit in a few days?
Resolved with https://github.com/open2c/pairtools/commit/f8963118d7baffc525a51c3f8e2abe083dccb06c