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

pep518: purge legacy numpy workaround in setup.py #361

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bjlittle
Copy link
Member

🚀 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 with python setup.py build_ext --inplace.

Copy link
Collaborator

@trexfeathers trexfeathers left a 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Collaborator

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
Copy link
Member

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants