Compatibility issue with 'watchdog' and Python 3.12

Open Beginner friendly
#7 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
docker, python
Domain
build-system

Research direction

Start with pyproject.toml and reproduce poetry install in a Python 3.12 environment using the Arch Linux Docker image described in the issue. Update the watchdog and Python constraints as needed; done means installation no longer fails on pathtools or the removed imp module.

Written by the indexing model from the issue text.

Description

We encountered compatibility issues when using the coredump-uploader with Python 3.12 in archlinux docker image due to the dependency on watchdog version <1.0.0(0.10.4 to be specific). The version of watchdog specified (^0.x.x) uses pathtools, which is incompatible with Python 3.12 because imp(a dependency of watchdog 0.10.4) is deprecated and removed in Python 3.12. It is also not compatible with PEP 517 build system.

To resolve this, we updated the pyproject.toml file to use watchdog version 1.0.0, which replaces pathtools with pathlib. This change resolves the compatibility issue.

Python version in tool.poetry.dependencies also needs to be adjusted( I use python = ">=3.6,<4.0").

Steps to Reproduce:

  1. Set up a Python 3.12 environment.
  2. Clone the coredump-uploader repository.
  3. Get poetry(I use ENV POETRY_HOME=/app/poetryInstallation && RUN curl -sSL https://install.python-poetry.org | python3 - --version 1.8.3 && ENV PATH="$PATH:$POETRY_HOME/bin"
  4. Run poetry install.

Observed Behavior:

  • poetry install fails with errors related to pathtools compatibility. (Note: This error originates from the build backend, and is likely not a problem with poetry but with pathtools (0.1.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "pathtools (==0.1.2)"')
  • I tried pip install --no-use-pep517 "pathtools==0.1.2" then got: ModuleNotFoundError: No module named 'imp'

My solution:

  • Update the pyproject.toml to use a newer watchdog version(I use 1.0.0).
  • Adjust the Python version accordingly( I use python = ">=3.6,<4.0")

Thank you for your attention to this issue. Please let me know if you need any further information.

Dominant language
Python
Stars
15
Forks
10
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/coredump-uploader

All issues in getsentry/coredump-uploader

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.