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

Problem using pyre2-updated with Python 3.13 #174

Open
dupuy opened this issue Jan 7, 2025 · 1 comment
Open

Problem using pyre2-updated with Python 3.13 #174

dupuy opened this issue Jan 7, 2025 · 1 comment
Labels
bug Something isn't working right python Updates to Python code or tooling

Comments

@dupuy
Copy link
Owner

dupuy commented Jan 7, 2025

Describe the problem

Using the pyre2-updated additional dependency with Python 3.13 fails with an error.

How you can reproduce the problem

Outline the steps to show the problem you are having.

  1. Create a PR adding Python 3.13 to the GHA python-app workflow configuration

  2. GHA logs:

PEP517 build of a dependency failed
Backend subprocess exited when trying to invoke build_wheel
    | Command '['/tmp/tmp1e9s6jwc/.venv/bin/python', '/opt/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py', 'build_wheel', '/tmp/tmp3nq78osn']' returned non-zero exit status 1.
    | Change Dir: '/tmp/tmpwctvvx4c/pyre2-updated-0.3.8/build/temp.linux-x86_64-cpython-313'
    ...
    | Run Build Command(s): /tmp/tmp1e9s6jwc/.venv/bin/ninja -v
    | [1/3] cd /tmp/tmpwctvvx4c/pyre2-updated-0.3.8/src && /tmp/tmp1e9s6jwc/.venv/bin/cython -a -3 --fast-fail --cplus -I /tmp/tmpwctvvx4c/pyre2-updated-0.3.8/src --output-file /tmp/tmpwctvvx4c/pyre2-updated-0.3.8/src/re2.cpp re2.pyx
    | [2/3] /usr/bin/c++ -DVERSION_INFO=0.3.8 -Dre2_EXPORTS -I/tmp/tmpwctvvx4c/pyre2-updated-0.3.8/src -I/opt/hostedtoolcache/Python/3.13.1/x64/include/python3.13 -O2 -g -DNDEBUG -std=c++11 -fPIC -MD -MT src/CMakeFiles/re2.dir/re2.cpp.o -MF src/CMakeFiles/re2.dir/re2.cpp.o.d -o src/CMakeFiles/re2.dir/re2.cpp.o -c /tmp/tmpwctvvx4c/pyre2-updated-0.3.8/src/re2.cpp
    | FAILED: src/CMakeFiles/re2.dir/re2.cpp.o 
    | /usr/bin/c++ -DVERSION_INFO=0.3.8 -Dre2_EXPORTS -I/tmp/tmpwctvvx4c/pyre2-updated-0.3.8/src -I/opt/hostedtoolcache/Python/3.13.1/x64/include/python3.13 -O2 -g -DNDEBUG -std=c++11 -fPIC -MD -MT src/CMakeFiles/re2.dir/re2.cpp.o -MF src/CMakeFiles/re2.dir/re2.cpp.o.d -o src/CMakeFiles/re2.dir/re2.cpp.o -c /tmp/tmpwctvvx4c/pyre2-updated-0.3.8/src/re2.cpp
    | /tmp/tmpwctvvx4c/pyre2-updated-0.3.8/src/re2.cpp:1255:10: fatal error: re2/stringpiece.h: No such file or directory
    |  1255 | #include "re2/stringpiece.h"
    |       |          ^~~~~~~~~~~~~~~~~~~
    | compilation terminated.
    | ninja: build stopped: subcommand failed.
    ...

Note: This error originates from the build backend, and is likely not a problem with poetry but
one of the following issues with pyre2-updated (0.3.8)

  - not supporting PEP 517 builds
  - not specifying PEP 517 build requirements correctly
  - the build requirements are incompatible with your operating system or Python version
  - the build requirements are missing system dependencies (eg: compilers, libraries, headers).

You can verify this by running pip wheel --no-cache-dir --use-pep517 "pyre2-updated (==0.3.8)".

Context

@dupuy dupuy added bug Something isn't working right python Updates to Python code or tooling labels Jan 7, 2025
@dupuy
Copy link
Owner Author

dupuy commented Jan 7, 2025

Fundamentally, this is a problem with upstream provider of pyre2-updated. If you are fine using standard Python RE library, there is no problem, and simply removing the additional dependency on RE2 will enable reliabot fallback behavior using standard Python RE.

As a workaround, if you want to use Reliabot pre-commit on a system using Python 3.13, you can add a language_version setting to the pre-commit configuration and pre-commit uses a Python 3.12 runtime:

  - repo: https://github.com/dupuy/reliabot
    rev: v0.2.4
    hooks:L
      - id: reliabot
        additional_dependencies: [pyre2-updated]
        language_version: python3.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right python Updates to Python code or tooling
Projects
None yet
Development

No branches or pull requests

1 participant