freelawproject / courtlistener

A fully-searchable and accessible archive of court data including growing repositories of opinions, oral arguments, judges, judicial financial records, and federal filings.
https://www.courtlistener.com
Other
552 stars 151 forks source link

Update python to version 3.13 #4572

Closed ttys0dev closed 1 month ago

mlissner commented 1 month ago

What's up with the migrations?

ttys0dev commented 1 month ago

What's up with the migrations?

Not sure, seems to be a no-op that gets generated under some circumstances.

mlissner commented 1 month ago

I got it. From 3.13's changelog:

image

ttys0dev commented 1 month ago

I got it. From 3.13's changelog:

Ah, that makes sense.

mlissner commented 1 month ago

Looks OK to me, but off to @albertisfu, for a more careful check. @ttys0dev did you have any ideas about trying the new fancy stuff in 3.13?

ttys0dev commented 1 month ago

did you have any ideas about trying the new fancy stuff in 3.13?

possibly, figured might see if can get some performance improvements

albertisfu commented 1 month ago

I tried to build the image for this update; however, it fails during the installation of scikit-learn 1.5.2 (which is the latest version) with the following error:

123.5   [209/249] Compiling C object sklearn/_loss/_loss.cpython-313-aarch64-linux-gnu.so.p/meson-generated_sklearn__loss__loss.pyx.c.o
123.5   ninja: build stopped: subcommand failed.
123.5
123.5
123.5   at /opt/poetry/lib/python3.13/site-packages/poetry/installation/chef.py:164 in _prepare
123.6       160│
123.6       161│                 error = ChefBuildError("\n\n".join(message_parts))
123.6       162│
123.6       163│             if error is not None:
123.6     → 164│                 raise error from None
123.6       165│
123.6       166│             return path
123.6       167│
123.6       168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
123.6
123.6 Note: This error originates from the build backend, and is likely not a problem with poetry but with scikit-learn (1.5.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "scikit-learn (==1.5.2)"'.
123.6
------
failed to solve: process "/bin/sh -c poetry install --no-root $(test \"$BUILD_ENV\" != \"dev\" && echo \"--without dev\")" did not complete successfully: exit code: 1

Full stack trace here: build-log.txt

It seems this is only happening on macOS for ARM64 architecture.

Maybe it's an incompatibility between the latest wheel published for scikit-learn and Python 3.13.

I'm afraid if we merge this one we could affect developers on Mac OS ARM64 machines.

Probably @ERosendo could also help confirm this is an issue on his Mac?

mlissner commented 1 month ago

Great. I put this on Eduardo's backlog to check. No rush.

ERosendo commented 1 month ago

Probably @ERosendo could also help confirm this is an issue on his Mac?

@albertisfu @mlissner I'm getting the same build error. However, It seems we can fix this by running poetry add scikit-learn@latest. This should update our poetry.lock file to include wheels for Python 3.13.

Our current .lock file doesn't include these wheels, likely because we updated scikit-learn before those wheels became officially available.

mlissner commented 1 month ago

Seems good to me. @ttys0dev, want to take it from here?

ttys0dev commented 1 month ago

@ttys0dev, want to take it from here?

Should be good now.

mlissner commented 1 month ago

@albertisfu, back to you for review. :)

ERosendo commented 1 month ago

@mlissner I successfully built the Docker image without encountering any errors. @ttys0dev's commit fixed the issue.

mlissner commented 1 month ago

Automerge is set! Here comes Python 3.13!

albertisfu commented 1 month ago

Yeah, the build is now working!

I only encountered an additional issue with pre-commit not working due to a different Python version. After updating it is now working properly.

It now looks ready for merging.