samuelcolvin / watchfiles

Simple, modern and fast file watching and code reload in Python.
https://watchfiles.helpmanual.io
MIT License
1.79k stars 108 forks source link

Release wheels for Python 3.13 #276

Closed hugovk closed 3 months ago

hugovk commented 6 months ago

The Python 3.13 beta is out and the release manager has a call to action:

We strongly encourage maintainers of third-party Python projects to test with 3.13 during the beta phase and report issues found to the Python bug tracker as soon as possible. While the release is planned to be feature complete entering the beta phase, it is possible that features may be modified or, in rare cases, deleted up until the start of the release candidate phase (Tuesday 2024-07-30). Our goal is to have no ABI changes after beta 4 and as few code changes as possible after 3.13.0rc1, the first release candidate. To achieve that, it will be extremely important to get as much exposure for 3.13 as possible during the beta phase.

To help test projects which use watchfiles, it would be very helpful to release wheels to PyPI for those of us who don't have the Rust toolchain set up. Currently we get:

❯ python3.13 -m pip install watchfiles
Collecting watchfiles
  Using cached watchfiles-0.21.0.tar.gz (37 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]

      Cargo, the Rust package manager, is not installed or is not on PATH.
      This package requires Rust and Cargo to compile extensions. Install it through
      the system's package manager or via https://rustup.rs/

      Checking for Rust toolchain....
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Thank you!

EwoutH commented 4 months ago

Currently my Python 3.13 CI build is stuck on watchfiles, with this error.

One thing that needs to be done is to update PyO3 to 0.22.0 or higher, since those support Python 3.13. There is a migration guide available here: https://pyo3.rs/v0.22.1/migration

In https://github.com/crate-py/rpds/pull/79 a similar upgrade was done, it might be useful as reference.

Unfortunately, I'm not a Rust dev, so not able to do it myself.

FlickerSoul commented 4 months ago

Hi Ewout, I saw your comment in rpds and tracked here :). I just made a PR to watchfiles to bump PyO3 to 0.22.x to support 3.13. Once it's merged, you should be able to use watchfiles in 3.13 with GIL. I can follow up when the GIL-less support from PyO3 is released. :)

samuelcolvin commented 3 months ago

v0.23.0 is released with support for 3.13.

Piyushj007 commented 1 month ago

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

run this command in git bash

some libraries need rust ompitler to run

samuelcolvin commented 1 month ago

the point is you don't need rust installed if there are binaries available, as their are for watchfiles.