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

Add scripts/run_all.py #2046

Merged
merged 4 commits into from May 4, 2023
Merged

Add scripts/run_all.py #2046

merged 4 commits into from May 4, 2023

Conversation

jprochazk
Copy link
Member

@jprochazk jprochazk commented May 4, 2023

First part of #1945

This PR adds scripts/run_all.py which is a port of the py-run-all recipe in the justfile.

Checklist

PR Build Summary: https://build.rerun.io/pr/2046

@jprochazk jprochazk added 🧑‍💻 dev experience developer experience (excluding CI) examples Issues relating to the Rerun examples labels May 4, 2023
from glob import glob


def run_py_example(path: str, args: list[str] = []) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

This fails on my Python 3.8.12 with:

❯ scripts/run_all.py
Traceback (most recent call last):
  File "scripts/run_all.py", line 12, in <module>
    def run_py_example(path: str, args: list[str] = []) -> None:
TypeError: 'type' object is not subscriptable

I assume you are using a newer Python?

Of course, this being python, the linter doesn't catch this 🤦 (Python 3.8 is our minimum supported version, and what is used on CI)

What we do elsewhere is from typing import List and then args: List[str].

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'm currently on 3.10. I guess I'll also downgrade to 3.8 to catch this stuff earlier.

Copy link
Member Author

Choose a reason for hiding this comment

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

$ python --version
Python 3.8.16

Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Nicely done!

@jprochazk jprochazk merged commit ec8333e into main May 4, 2023
15 checks passed
@jprochazk jprochazk deleted the jan/run-all-examples branch May 4, 2023 18:28
@emilk emilk changed the title add run_all.py Add scripts/run_all.py May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍💻 dev experience developer experience (excluding CI) examples Issues relating to the Rerun examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants