Skip to content
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

Python 3.13 #516

Open
raphaelauv opened this issue Oct 15, 2024 · 6 comments
Open

Python 3.13 #516

raphaelauv opened this issue Oct 15, 2024 · 6 comments

Comments

@raphaelauv
Copy link

hi , some wheels for Python package https://pypi.org/project/google-re2/ for Python 3.13 would help a lot , thanks all 👍

@raphaelauv
Copy link
Author

when I try to build, I hit the error

2.598       /usr/local/include/python3.13/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
2.598          22 | typedef struct _frame PyFrameObject;
2.598             |                ^~~~~~
2.598       error: command '/usr/bin/g++' failed with exit code 1
2.598       [end of output]

@andife
Copy link

andife commented Oct 19, 2024

I am also very interested in a python 3.13 compatible release. Could you share the whole error log?

@xceberg3058
Copy link

I am also very interested in a python 3.13 compatible release for google-re2, Thanks !

@andersk
Copy link

andersk commented Oct 21, 2024

It already builds fine with sufficiently recent versions of dependencies (Abseil, pybind11, re2). For example, on Ubuntu 24.10:

$ docker run --pull=always --rm -it ubuntu:24.10
root@229a132a6b4a:/# apt update
root@229a132a6b4a:/# apt install -y --no-install-recommends g++ libabsl-dev libre2-dev pybind11-dev python3.13-dev python3.13-venv
root@229a132a6b4a:/# python3.13 -m venv venv
root@229a132a6b4a:/# . venv/bin/activate
(venv) root@229a132a6b4a:/# pip install google-re2
Collecting google-re2
  Downloading google_re2-1.1.20240702.tar.gz (11 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: google-re2
  Building wheel for google-re2 (pyproject.toml) ... done
  Created wheel for google-re2: filename=google_re2-1.1.20240702-cp313-cp313-linux_x86_64.whl size=1663356 sha256=18a2878c8b22afdae98eb66ab95745fa045658fa3a01dc51fa686ea7f28269e0
  Stored in directory: /root/.cache/pip/wheels/8e/ee/2d/36f51c4a17497ae98352ac575d982f06706dbb917a9ce66c69
Successfully built google-re2
Installing collected packages: google-re2
Successfully installed google-re2-1.1.20240702
(venv) root@229a132a6b4a:/# python
Python 3.13.0 (main, Oct  7 2024, 21:58:50) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import re2
>>> re2.match("a?" * 26 + "a" * 26, "a" * 26)
<re2._Match object at 0x7fab72a60ae0>

All we need are binary wheels for Python 3.13 so it works on every typical platform. Opened https://code-review.googlesource.com/c/re2/+/63490.

@raphaelauv
Copy link
Author

raphaelauv commented Oct 21, 2024

yes, this work

FROM ubuntu:24.10

RUN  apt-get update \
  && apt install -y --no-install-recommends g++ libabsl-dev libre2-dev pybind11-dev python3.13-dev python3-pip \
  && rm -rf /var/lib/apt/lists/*

RUN python3.13 -m pip install google-re2 --break-system-packages

@lorenzogatti
Copy link

Requiring Windows users to install Abseil (and, I assume, PyBind11) on their own is very nonstandard and very impractical.
Isn't it possible to put everything needed in the PyPI package? Binary wheels would be, of course, even better.
The following is a pathetic installation attempt with Windows 10 and Python 3.13:


>pip install google-re2
Collecting google-re2
  Downloading google_re2-1.1.20240702.tar.gz (11 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: google-re2
  Building wheel for google-re2 (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for google-re2 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win-amd64-cpython-313\re2
      copying re2\__init__.py -> build\lib.win-amd64-cpython-313\re2
      running build_ext
      building '_re2' extension
      creating build\temp.win-amd64-cpython-313\Release
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Python\include -IC:\Python\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tp_re2.cc /Fobuild\temp.win-amd64-cpython-313\Release\_re2.obj -fvisibility=hidden
      cl : Command line warning D9002 : ignoring unknown option '-fvisibility=hidden'
      _re2.cc
      _re2.cc(15): fatal error C1083: Cannot open include file: 'absl/strings/string_view.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for google-re2
Failed to build google-re2
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (google-re2)

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

No branches or pull requests

5 participants