Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Replace backend_driver by new example runner. #17226

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 8, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Apr 23, 2020

backend_driver has been really outdated for a long time. Replace it by
a new script running all or a subset of the examples scripts.

Supersedes #8069 (@dstansby).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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

help="examples to run; defaults to all examples (except *_sgskip.py)")
args = parser.parse_args()

root = (Path(__file__).parent / "../examples").resolve()
Copy link
Member

Choose a reason for hiding this comment

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

.parent and ..?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the first parent is basically dirname(); I guess the other option would be .parents[1] / "examples" but I always find it hard to get the right index in the brackets...

Copy link
Member

Choose a reason for hiding this comment

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

Could do .parent.parent, maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, that's fine too

@efiring
Copy link
Member

efiring commented May 8, 2020

Shouldn't it be possible to run this with no arguments?

(mpl1) ~/work/programs/py/mpl/matplotlib/tools $ python run_examples.py
Traceback (most recent call last):
  File "run_examples.py", line 91, in <module>
    main()
  File "run_examples.py", line 66, in main
    width = max(len(str(relpath)) for relpath in relpaths)
ValueError: max() arg is an empty sequence

backend_driver has been really outdated for a long time.  Replace it by
a new script running all or a subset of the examples scripts.
@anntzer
Copy link
Contributor Author

anntzer commented May 8, 2020

oops, should be fixed now.

@tacaswell tacaswell merged commit b786dcd into matplotlib:master May 8, 2020
@anntzer anntzer deleted the driver branch May 8, 2020 22:02
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.

4 participants