Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simplify extension setup.#11964

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dstansby merged 1 commit intomatplotlib:masterfromanntzer:delayedextension
Feb 27, 2019
Merged

Conversation

anntzer
Copy link
Contributor

@anntzeranntzer commentedAug 28, 2018
edited
Loading

setupext currently has a complex machinery to define extension modules.
Essentially, the problem is that numpy may not be installed at the time
the extensions are declared, so we can't call np.get_include() to get
the include paths. So we use a DelayedExtension class and a hook
mechanism to inject the numpy include path later, once it becomes
available.

Instead, we can just declare a dummy extension (so that setuptools
doesn't elide the call to build_ext), then swap in the correct
extensions in build_ext.finalize_options(): at that point, numpy will
have been installed and we don't need any crazy machinery.

Alsocloses#6928 by not attempting to reload numpy anymore.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer
Copy link
ContributorAuthor

Rebased on top of#11983 which makes things a bit simpler.

@tacaswell
Copy link
Member

Tried to power cycled to see if it would simplify the diff now that#11983 is merged,@anntzer mind rebasing this again to make it easier to review?

@anntzer
Copy link
ContributorAuthor

Done.

@jklymakjklymak added the Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labelFeb 10, 2019
@jklymak
Copy link
Member

Marking release critical so it gets some love.. I'd review, but really don't grok whats going on here. But if someone more knowledgeable reviewed, I'd be comfortable approving as not doing anything dangerous.

@timhoffm
Copy link
Member

Sorry, can’t help either. Not experienced in setuptools.

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

As discussed on call this simplifies the build process and we will not discover any edge cases until we try to build all of the wheels / packages.

@anntzer
Copy link
ContributorAuthor

@tacaswell do you want to entice a second reviewer? :)

Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

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

Dunno if you want to change this one line.

setupext currently has a complex machinery to define extension modules.Essentially, the problem is that numpy may not be installed at the timethe extensions are declared, so we can't call np.get_include() to getthe include paths.  So we use a DelayedExtension class and a hookmechanism to inject the numpy include path later, once it becomesavailable.Instead, we can just declare a dummy extension (so that setuptoolsdoesn't elide the call to build_ext), then swap in the correctextensions in build_ext.finalize_options(): at that point, numpy willhave been installed and we don't need any crazy machinery.
@dstansby
Copy link
Member

Going to merge based on two previous +ive reviews.

@dstansbydstansby merged commit85eb5eb intomatplotlib:masterFeb 27, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestFeb 27, 2019
@anntzeranntzer deleted the delayedextension branchFebruary 27, 2019 12:38
dstansby added a commit that referenced this pull requestFeb 27, 2019
…964-on-v3.1.xBackport PR#11964 on branch v3.1.x (Simplify extension setup.)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@QuLogicQuLogicQuLogic approved these changes

Assignees
No one assigned
Labels
BuildRelease criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Milestone
v3.1.0
Development

Successfully merging this pull request may close these issues.

Cannot runsetup.py build with numpy master
6 participants
@anntzer@tacaswell@jklymak@timhoffm@dstansby@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp