-
Notifications
You must be signed in to change notification settings - Fork 49
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
pep518: purge legacy numpy workaround in setup.py #361
Conversation
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 started checking over this but I'm struggling to understand the context so I'll have to stop and leave the comments I had so far.
Something to come back to (or that someone else can take over)
cythonize = False | ||
wmsg = "Cython unavailable, unable to cythonize cf-units extensions!" | ||
warnings.warn(wmsg) | ||
cythonize = None |
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.
cythonize = None | |
cythonize = False |
Previous was clearer in IMO
|
||
if FLAG_COVERAGE in sys.argv or environ.get("CYTHON_COVERAGE", None): | ||
if cythonize and cython_coverage_enabled: |
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.
Why has this changed from or
to and
?
from distutils.sysconfig import get_config_var | ||
from os import environ | ||
from pathlib import Path | ||
from shutil import copy | ||
|
||
# safe to import numpy here thanks to pep518 | ||
import numpy as np | ||
from setuptools import Command, Extension, setup | ||
|
||
# Default to using cython, but use the .c files if it doesn't exist |
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.
Why would we want to have a build-time dependency on numpy, but an optional build-time dependency on Cython. Surely we can now move to a world where we unconditionally depend on Cython for building from source (and sdist)?
🚀 Pull Request
Description
This PR addresses some long outstanding technical debt, which thanks to pep518, we can finally tidy-up and simplify.
As a side-effect, developers can now easily build
cf-units
withpython setup.py build_ext --inplace
.