In my project, I have a small amount of actual .pyx code and a huge amount of generated code. It makes grep essentially useless
As usual, I have a tiny demo, and it's here: https://github.com/rec/simple-cython/blob/master/simple.pyx#L3-L4 Works, but fails if I uncomment that line.
Is there a way I can change just setup.py file to also allow that .pyx in the other directory to be found?
Thanks in advance!
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
As I understnd it, for ease of writting cyton, it really works best fto put the generated cocee4 next to the *.pyx code. Though I'm sure patches would be considered :-)On Fri, Jun 24, 2016 at 9:50 AM, Tom Swirly <t...@swirly.com> wrote:In my project, I have a small amount of actual .pyx code and a huge amount of generated code. It makes grep essentially uselessI'm really confused, your code is .pyx, the generated code is *.c (or *.cpp) -- can't you put a wildcard in to your grep command???? I do that all the time.
if you have a bunch of hand-written C code as well, it's not hard to put that in a separate dir.though, if you are OK with running cython yourself, rather than using cythonize and having distutils run it, you could put the generated code anywhere and have it included in the extension in your setup.py.As usual, I have a tiny demo, and it's here: https://github.com/rec/simple-cython/blob/master/simple.pyx#L3-L4 Works, but fails if I uncomment that line.can't tell what you are trying to do there.
include "timedata/color/color_base.pyx" | |
include "timedata/color/color.pyx" | |
include "src/pyx/timedata/color/color_base.pyx" | |
include "build/genfiles/timedata/color/color.pyx" | |
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
hmm,a thought here:distutils creates a "build" dir for, well, building a package before installing it, etc.perhaps the generated cython files should be put there, rather than in the source dir.-CHB
Thanks for the reply! I feel a little bad taking you away from your work, more important than my flashing lights. :-)I came up with an ugly but fast and effective workaround so there's no real need to read but others might find it helpful.On Fri, Jun 24, 2016 at 3:47 PM, Chris Barker <chris....@noaa.gov> wrote:As I understnd it, for ease of writting cyton, it really works best fto put the generated cocee4 next to the *.pyx code. Though I'm sure patches would be considered :-)On Fri, Jun 24, 2016 at 9:50 AM, Tom Swirly <t...@swirly.com> wrote:In my project, I have a small amount of actual .pyx code and a huge amount of generated code. It makes grep essentially uselessI'm really confused, your code is .pyx, the generated code is *.c (or *.cpp) -- can't you put a wildcard in to your grep command???? I do that all the time.Right now I have generated .pyx files and hand-edited .pyx (and .cpp and .h files but those I can move) in the same directory structure. There's no obvious grep pattern that will eliminate only the generated .pyx files though I could craft one fairly easily.But I really want a separate directory for generated files - it's not just that I'm bad at using grep. :-DRight now, some of these directories contain a dozen generated .pyx files and only a few hand-written ones. It's visual and mental clutter.I shouldn't be writing generated things into random areas in my source directories and then having a bunch of specific .gitignores to not check them in - generated files all should go into the build subdirectory, just like object files and other temporaries.Here's the planned structure.if you have a bunch of hand-written C code as well, it's not hard to put that in a separate dir.though, if you are OK with running cython yourself, rather than using cythonize and having distutils run it, you could put the generated code anywhere and have it included in the extension in your setup.py.As usual, I have a tiny demo, and it's here: https://github.com/rec/simple-cython/blob/master/simple.pyx#L3-L4 Works, but fails if I uncomment that line.can't tell what you are trying to do there.As the code is, it works.Uncomment that one single line, it fails... because it can't find that sub2.pyx in the directory named subd.I want to "add that one directory to my PYXPATH" (yes, I know that idea doesn't exist :-D ).In Python, I'd add a directory to PYTHONPATH or, at runtime, to sys.path.In C or C++, I'd add it using a -I command line flag.In Java I'd add it to my CLASSPATH