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

Tweak subprocess_run_helper. #23110

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

Merged
merged 1 commit into from
May 27, 2022
Merged

Tweak subprocess_run_helper. #23110

merged 1 commit into from
May 27, 2022

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented May 23, 2022

On general grounds, an API like
subprocess_run_helper(func, *args, timeout, **extra_env)
is problematic because it prevents one from passing an environment
variable called "timeout".

Instead, pass the extra environment variables as a dict, without
unpacking.

(Technically this has been released in 3.5.2 as public API, but 1) I'm
not really sure it should have been a public API to start with (should
we deprecate it and make it private?), and 2) hopefully tweaking that in
3.5.3 with no deprecation is not going to disrupt anyone... I can still
put in a changelog entry if that's preferred.)

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

The change is reasonable. Given that it has just been introduced and given that we haven't advertised it in a changelog or similar, the change of somebody using this is minimal. So I'm fine with changing without a deprecation even though it's technically public API.

I'm not clear for the whole testing subpackage whether we consider this public API or only internal helpers. I'd tend to say that subprocess_run_helper() could be private as well.

@tacaswell
Copy link
Member

I agree, did not think through this API carefully enough.

@tacaswell
Copy link
Member

Passing env is required, not sure if you intended that @anntzer .

@anntzer
Copy link
Contributor Author

anntzer commented May 27, 2022

That was a mistake on my side, fixed.

lib/matplotlib/testing/__init__.py Outdated Show resolved Hide resolved
lib/matplotlib/testing/__init__.py Show resolved Hide resolved
On general grounds, an API like
`subprocess_run_helper(func, *args, timeout, **extra_env)`
is problematic because it prevents one from passing an environment
variable called "timeout".

Instead, pass the extra environment variables as a dict, without
unpacking.

(Technically this has been released in 3.5.2 as public API, but 1) I'm
not really sure it should have been a public API to start with (should
we deprecate it and make it private?), and 2) hopefully tweaking that in
3.5.3 with no deprecation is not going to disrupt anyone...  I can still
put in a changelog entry if that's preferred.)
@QuLogic QuLogic merged commit 4d7c309 into matplotlib:main May 27, 2022
@lumberbot-app
Copy link

lumberbot-app bot commented May 27, 2022

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.5.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 4d7c309190745daa861102ec9c6c72766cc1047f
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #23110: Tweak subprocess_run_helper.'
  1. Push to a named branch:
git push YOURFORK v3.5.x:auto-backport-of-pr-23110-on-v3.5.x
  1. Create a PR against branch v3.5.x, I would have named this PR:

"Backport PR #23110 on branch v3.5.x (Tweak subprocess_run_helper.)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

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

Successfully merging this pull request may close these issues.

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