Skip to content

DeprecationWarning from itertools in Python 3.13.2 with movement Tests #483

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
ShigrafS opened this issue Mar 11, 2025 · 2 comments
Open

Comments

@ShigrafS
Copy link
Contributor

Description

What is this issue?

While running tests locally for the movement package on Windows with Python 3.13.2, I encountered a DeprecationWarning indicating that pickle, copy, and deepcopy support will be removed from itertools in Python 3.14. This warning appears during tox test runs and may affect future compatibility.

Details

  • Environment: Windows, Python 3.13.2 (MSC v.1942 64-bit AMD64), tox environment py313.
  • Command: tox -e py313.
  • Warning Output:
    C:\Program Files\Python313\Lib\copy.py:169: DeprecationWarning: Pickle, copy, and deepcopy support will be removed from itertools in Python 3.14.
    
  • Context: Occurs during pytest tests/ --cov=movement execution, with all 686 tests passing and 99% coverage. The warning is emitted twice in the log.
  • Source: The warning originates from Python’s standard library (copy.py), likely triggered by a dependency or internal use of itertools with copy/deepcopy.

Why is this an issue?

  • While currently just a warning, this signals a potential breaking change in Python 3.14, which could disrupt movement functionality or test runs if not addressed.
  • It’s unclear which part of movement or its dependencies (e.g., pytest, xarray, PyQt6) triggers this, requiring investigation.

Steps to Reproduce

  1. Install Python 3.13.2 on a Windows machine.
  2. Clone the movement repo: git clone https://github.com/neuroinformatics-unit/movement.git.
  3. Navigate to the repo: cd movement.
  4. Install tox: pip install tox.
  5. Run tests: tox -e py313.
  6. Observe the DeprecationWarning in the output.

Expected Behavior

Tests should run without deprecation warnings, ensuring compatibility with future Python versions.

Actual Behavior

Tests pass, but the DeprecationWarning appears twice, hinting at future incompatibility with Python 3.14.

Suggested Actions

  • Investigate which dependency or movement code uses itertools with copy/deepcopy.
  • Suppress the warning temporarily (e.g., via pytest.ini) if it’s benign and stems from a dependency we can’t control:
    [pytest]
    filterwarnings =
        ignore::DeprecationWarning:copy
  • Update the codebase or dependencies to avoid this deprecated behavior before Python 3.14.

Additional Info

  • Python 3.13.2 was released recently, and this may be a new warning not seen in earlier versions.
  • The full dependency list from my run includes PyQt6, pytest, napari, xarray, etc.—a traceback or deeper inspection might pinpoint the culprit.

References

  • Python 3.14 deprecation note (implied in the warning; no specific PEP referenced yet).
@ShigrafS
Copy link
Contributor Author

@niksirbi @adamltyson
Is this a good issue to work on?

@niksirbi
Copy link
Member

Thanks for the detailed report on this @ShigrafS. I'd seen similar warnings myself but hadn't found the time to document them so thoroughly, as you've done here.

At this stage, I would simply try to investigate whether movement is causing this, or one of our dependencies. If the former, we should fix it. If the latter, hopefully the problem will go away on its own (i.e. someone else will fix it) before Python 3.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🤔 Triage
Development

No branches or pull requests

2 participants