Skip to content

[Python] Editing a .pyx requires building extensions twice for the change to take effect #50702

Description

@raulcd

Describe the bug, including details regarding any error messages, version, and platform.

I've found a couple of places where I am modifying some Cython code on a .pyx file and when I rebuild the expected changes are not in effect, if I rebuild a second time the changes take effect.

If I take a look after a build:

$ # edit python/pyarrow/_flight.pyx
$ python -m pip install -C cmake.build-type=Debug -C build.verbose=true --no-deps --no-build-isolation -vv --config-settings=build-dir=build -e .
$ ls -lrta pyarrow/_flight.pyx build/_flight.cpp build/debug/_flight.cpython-313-x86_64-linux-gnu.so
-rwxrwxr-x 1 raulcd raulcd 6847840 Jul 29 09:59 build/debug/_flight.cpython-313-x86_64-linux-gnu.so
-rw-rw-r-- 1 raulcd raulcd  114900 Jul 29 10:02 pyarrow/_flight.pyx
-rw-rw-r-- 1 raulcd raulcd 4288269 Jul 29 10:02 build/_flight.cpp

The cpp file was re-generated but the _flight.cpython-313-x86_64-linux-gnu.so was not, it predates the build time and the pyx change.

Component(s)

Python

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions