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

Setuptools doesn't play nice with Numpy #752

Closed
bcbrown opened this Issue Aug 20, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@bcbrown

bcbrown commented Aug 20, 2016

See: https://github.com/numpy/numpy/blob/master/numpy/distutils/extension.py#L42-L52

That functionality was broken by:
https://github.com/pypa/setuptools/blob/master/setuptools/extension.py#L39-L41

In this pr: #718

Here's the the pdb session where I debugged this:

(Pdb) old_Extension.__module__
'setuptools.extension'
@tlandschoff-scale

This comment has been minimized.

Contributor

tlandschoff-scale commented Aug 20, 2016

Oops, I just sunk some time because of this and (wrongly) traced it to #728. Only after creating a simple travis build to illustrate this did I think about looking at the newest issues.

Currently it seems impossible to install numpy from source on a Unix system, as this build illustrates:

Build Status

It seems like @bcbrown is correct about the location of this problem.

@tlandschoff-scale

This comment has been minimized.

Contributor

tlandschoff-scale commented Aug 20, 2016

I made pull request #753 for this, not sure why it is not picked up automatically.

@jaraco jaraco closed this in d687531 Aug 20, 2016

jaraco added a commit that referenced this issue Aug 20, 2016

Merge pull request #753 from tlandschoff-scale/master
Make Extension accept positional arguments again (fixes #752).
@jaraco

This comment has been minimized.

Member

jaraco commented Aug 20, 2016

Can I also recommend that numpy only pass keyword arguments to Extension (for future simplicity)?

@tlandschoff-scale

This comment has been minimized.

Contributor

tlandschoff-scale commented Aug 21, 2016

I think this is a good case for PEP 3102 keyword only arguments. Unfortunately they are available only starting with CPython 3. One of the great improvements - in my eyes the API should define if parameters should be passed positional or via keyword to ease backwards compatibility.

I think the best that setuptools can do is to generate a warning when positional arguments are used for the keyword parameters of Extension. Probably my company is not the only Python user that partially has obsolete libraries in use (be it for updates to a legacy branch of the software) but try to use the newest setuptools and pip packages for installing them...

@jaraco

This comment has been minimized.

Member

jaraco commented Aug 22, 2016

I think this is a good case for PEP 3102 keyword only arguments.

I had the same thought (and same conclusions).

I think the best that setuptools can do is to generate a warning when positional arguments are used for the keyword parameters of Extension.

Seems a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment