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

hooks: matplotlib: assert that mpl_data_dir is not empty #5629

Merged
merged 2 commits into from Mar 13, 2021

Conversation

rokm
Copy link
Member

@rokm rokm commented Mar 12, 2021

If the statement in exec_statement() fails for whatever reason, mpl_data_dir ends up empty, which in turn cases the current working directory being collected as matplotlib/mpl-data.

This leads to difficult-to-debug issues (see confusion around .git directory under #5504), so it's better to just signal the error.

If the statement in exec_statement() fails for whatever reason,
mpl_data_dir ends up empty, which in turn cases the current working
directory being collected as matplotlib/mpl-data.

This leads to difficult-to-debug issues (see confusion around .git
directory under pyinstaller#5504), so it's better to just signal the error.
@rokm rokm force-pushed the hooks-matplotlib-assert-datadir branch from dabd9d7 to f3d48be Compare March 12, 2021 12:45
@bwoodsend
Copy link
Member

Hmm, looks like there's something washed up by this. I notice that this failing job is the only one that installs matplotlib from source.

@rokm
Copy link
Member Author

rokm commented Mar 12, 2021

Hmm, looks like there's something washed up by this. I notice that this failing job is the only one that installs matplotlib from source.

Ah, so it's building it from source.

The test itself ends up with empty mpt_data_dir because matplotlib fails to import due incompatibility in numpy:

 ------- Starting build. -------
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/runner/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/site-packages/matplotlib/__init__.py", line 207, in <module>
    _check_versions()
  File "/Users/runner/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/site-packages/matplotlib/__init__.py", line 192, in _check_versions
    from . import ft2font
ImportError: numpy.core.multiarray failed to import

Search results for module compiled against API version 0xe but this version of numpy is 0xd seem to suggest that the problem lies in pip not honoring the pinned version of build dependencies: pypa/pip#9542.

So this should probably go away if we pin numpy to the latest available version.

@rokm
Copy link
Member Author

rokm commented Mar 12, 2021

Or maybe if we get the CI to install pinned version of numpy before matplotlib.

@bwoodsend
Copy link
Member

Ughh pypa/pip#9542 looks hellish. I'd rather just re-pin matplotlib?

@rokm
Copy link
Member Author

rokm commented Mar 12, 2021

Ughh pypa/pip#9542 looks hellish. I'd rather just re-pin matplotlib?

You're right. Re-pinning matplotlib to 3.3.4 should probably also do the trick as it has wheels for all python versions against which we test. I'll push a commit once AppVeyor finishes its current round.

@bwoodsend bwoodsend added the merge-on-ci-pass This PR is ready to merge providing CI passes label Mar 12, 2021
@AppVeyorBot
Copy link

Build pyinstaller 1.0.965 completed (commit c137ed5a81 by @rokm)

@bwoodsend
Copy link
Member

white_check_mark Build pyinstaller 1.0.965 completed (commit c137ed5 by @rokm)

Yipee it worked!

@bwoodsend bwoodsend merged commit a6af9d1 into pyinstaller:develop Mar 13, 2021
@rokm rokm deleted the hooks-matplotlib-assert-datadir branch March 22, 2021 19:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
merge-on-ci-pass This PR is ready to merge providing CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants