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

Check files before overwriting during compilation #3041

sehoffmann opened this issue Jul 12, 2019 · 0 comments


Copy link

commented Jul 12, 2019

It would be nice for Cython to check if a file can be safely overridden when generating .c or .cpp files.

This can easily be done by checking the first line for "/* Generated by Cython ..." or a similiar flag.
If that line is missing, the build process should be stopped and a warning should be emitted, forcing the user to either manually check and delete the files or to pass an yet-to-introduce flag which disables this behaviour.

The scenario which led me to open this issue:

  1. I'm implementing some performance-critical sections directly in a .cpp file
  2. Classes used to interact with Python are exposed in identically named .h and .pxd files.
  3. One of the classes required an Extension Class, forcing me to create a .pyx file.
  4. Me forgetting that conda-develop -b builds inplace by default, resulted in the newly generated .cpp file overwritting one day's worth of work.

I think this is a relatively easy to implement feature, which could prevent some frustration in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.