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

Appearance settings

Conversation

@QuLogic
Copy link
Member

@QuLogic QuLogic commented Sep 5, 2024

PR summary

For a ditry tree, setuptools-scm adds the date to the end of the version. This test runs a subprocess and subprocess_run_helper will set SOURCE_DATE_EPOCH=0, which forces the date to be 1970-01-01, triggering a mismatched version warning on unpickle.

Since we aren't testing the version-compatibility warning, set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MATPLOTLIB in the subprocess call so that versions match.

We also need to set the dist_name parameter when querying setuptools-scm or it won't check that environment variable.

This is something I've long seen, but never investigated.

PR checklist

@timhoffm
Copy link
Member

timhoffm commented Sep 5, 2024

would it be better to use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${NORMALIZED_DIST_NAME}? (see the warning in https://setuptools-scm.readthedocs.io/en/latest/config/#environment-variables)

@QuLogic
Copy link
Member Author

QuLogic commented Sep 5, 2024

I wasn't sure when that was added, but it looks like 5.0.1, so that should be fine.

lib/matplotlib/tests/test_pickle.py Outdated Show resolved Hide resolved
For a ditry tree, `setuptools-scm` adds the date to the end of the
version. This test runs a subprocess and `subprocess_run_helper` will
set `SOURCE_DATE_EPOCH=0`, which forces the date to be 1970-01-01,
triggering a mismatched version warning on unpickle.

Since we aren't testing the version-compatibility warning, set
`SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MATPLOTLIB` in the subprocess call
so that versions match.

Also, set the `dist_name` parameter when querying setuptools-scm or it
won't check that environment variable.
@tacaswell
Copy link
Member

I'm going to merge over a test_determinism_svg test on one platform.

@tacaswell tacaswell merged commit b95421e into matplotlib:main Sep 6, 2024
@tacaswell
Copy link
Member

Thank you @QuLogic ! This has been bugging me for a while but I have not had time to track it down.

@QuLogic QuLogic added topic: testing topic: pickle Issues to do with pickling labels Sep 6, 2024
@QuLogic QuLogic added this to the v3.10.0 milestone Sep 6, 2024
@QuLogic QuLogic deleted the test-fix-pickle branch September 6, 2024 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: pickle Issues to do with pickling topic: testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.