Skip to content

Use 313 version of watchdog on mac 314#93

Open
rchl wants to merge 1 commit into
packagecontrol:mainfrom
rchl:fix/watchdog-314
Open

Use 313 version of watchdog on mac 314#93
rchl wants to merge 1 commit into
packagecontrol:mainfrom
rchl:fix/watchdog-314

Conversation

@rchl
Copy link
Copy Markdown
Contributor

@rchl rchl commented May 3, 2026

I don't know how safe this is but 313 version seems to work in python 314 host when I try it in standalone python.

It would fix LSP-copilot which currently doesn't work on mac due to this dependency not being available. It's available on Linux and Windows because files are not as strictly versioned there.

@michaelblyons
Copy link
Copy Markdown

michaelblyons commented May 3, 2026

🤷 Seems reasonable to me.

Upstream issue: gorakhargosh/watchdog#1143

Alternatively (and no idea if this is safe), Chia built their own, which is available at https://pypi.chia.net/simple/watchdog/

@deathaxe
Copy link
Copy Markdown
Collaborator

deathaxe commented May 3, 2026

Has anyone checked out watchfiles? It also seems to support asyncio.

@rchl
Copy link
Copy Markdown
Contributor Author

rchl commented May 4, 2026

Up to @jfcherng to decide but not sure if he'd want to introduce asyncio dependency.

@jfcherng
Copy link
Copy Markdown
Contributor

jfcherng commented May 4, 2026

Up to @jfcherng to decide but not sure if he'd want to introduce asyncio dependency.

I think we are fine to do that.

@jfcherng
Copy link
Copy Markdown
Contributor

jfcherng commented May 4, 2026

The library "watchfiles" is not available for Python 3.14.

And it also depends on anyio (and more), which has no wheel on pypi.

That seems making the refactoring more complicated than I thought it would be.


Having a py314 experiment branch: https://github.com/sublimelsp/LSP-copilot/tree/refactor/use-watchfiles

I don't think we are going to use "watchfiles" at this moment.

@deathaxe
Copy link
Copy Markdown
Collaborator

deathaxe commented May 4, 2026

watchfiles has just not yet been added to libraries channel. (see: #94) It can be tested easily by just extracting the wheel to ST's Lib/python314 folder. It only depends on anyio to drive optional asyncio watcher. It also has a synchronous API though. When using asyncio, it should be run using sublime_aio instead of starting another thread.

@jfcherng
Copy link
Copy Markdown
Contributor

jfcherng commented May 6, 2026

watchfiles has just not yet been added to libraries channel. (see: #94) It can be tested easily by just extracting the wheel to ST's Lib/python314 folder. It only depends on anyio to drive optional asyncio watcher. It also has a synchronous API though. When using asyncio, it should be run using sublime_aio instead of starting another thread.

[jfcherng@3bc-f19 x]$ uv v --python=38
Using CPython 3.8.20
Creating virtual environment at: .venv
Activate with: .venv\Scripts\activate
[jfcherng@3bc-f19 x]$ uvsh
[INFO] Activate Python venv: .venv (via .venv/Scripts/activate)
(x) [jfcherng@3bc-f19 x]$ uv pip install watchfiles
Resolved 6 packages in 3.61s
Prepared 3 packages in 25.00s
Installed 6 packages in 159ms
 + anyio==4.5.2
 + exceptiongroup==1.3.1
 + idna==3.13
 + sniffio==1.3.1
 + typing-extensions==4.13.2
 + watchfiles==0.24.0

For py38, there are some more deps: exceptiongroup and sniffio

@deathaxe
Copy link
Copy Markdown
Collaborator

deathaxe commented May 6, 2026

Conflicts are about 314. Given 38 is eol, packages possibly need to create new release branches anytime soon anyway.

@rchl
Copy link
Copy Markdown
Contributor Author

rchl commented May 6, 2026

It's a bit much to expect to maintain two separate code bases with completely different watcher implementations.

And 3.8 is not eol in context of ST. It can still take months for ST with 3.14 to become stable.

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.

4 participants