-
Notifications
You must be signed in to change notification settings - Fork 42
don't use cythonize in setup.py #379
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
base: master
Are you sure you want to change the base?
Conversation
neutrinoceros
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the ping. I don't understand how this is supposed to work yet, and with a red CI I'm not yet convinced it should.
setup.py
Outdated
| e.cython_directives = {'language_level': "3"} | ||
| e.compiler_directives = COMPILER_DIRECTIVES | ||
| # remove _cftime.c file if it exists, so cython will recompile _cftime.pyx. | ||
| if len(sys.argv) >= 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what the intention for this check is. Seems to me there are many ways to end up executing this code with completely different commands so I'm a bit unconfortable with it. Can you explain ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idea is that anytime you run setup.py, you will want to recompile _cftime.pyx. If there is a left-over _cftime.c file, then cython won't run, so this code removes it if it exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the setuptools docs:
"When your Cython extension modules are declared using the setuptools.Extension class, setuptools will detect at build time whether Cython is installed or not.
If Cython is present, then setuptools will use it to build the .pyx files. Otherwise, setuptools will try to find and compile the equivalent .c files (instead of .pyx). These files can be generated using the cython command line tool."
so you don't really need to use cythonize explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idea is that anytime you run setup.py, you will want to recompile _cftime.pyx
but why would this be captured specifically by the number of CLI arguments ? This is what I'm having a hard time wrapping my head around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this from netcdf4-python - I think it can be removed.
|
Don't know why the wheels fail some tests |
@neutrinoceros hopefully this will help with PR #372