Skip to content

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

Closed

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

Activity

  1. changed the title [-][Python] Editing a .pyx requires running build_ext twice for the change to take effect[/-] [+][Python] Editing a .pyx requires building extensions twice for the change to take effect[/+] on Jul 29, 2026
  2. pratyushadk commented on Jul 29, 2026

    @pratyushadk
    Contributor

    hey, this issue looks interesting, can i give it a try?

  3. raulcd commented on Jul 29, 2026

    @raulcd
    MemberAuthor

    sure, feel free to try.

  4. added a commit that references this issue on Jul 30, 2026
  5. added this to the 26.0.0 milestone on Jul 30, 2026
  6. pitrou commented on Jul 30, 2026

    @pitrou
    Member

    Issue resolved by pull request 50719
    #50719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions