Skip to content

Added logic to create a default robot.py from the arcade drive examle #145

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gerth2
Copy link

@gerth2 gerth2 commented Jun 20, 2025

Rather than being blank. This should help ensure deployability.

…e, rather than being blank. This should help ensure deployability.
@@ -18,17 +20,29 @@ class Init:
def __init__(self, parser: argparse.ArgumentParser):
pass

def _default_main_file(self, main_file: pathlib.Path)-> None:
source = "https://raw.githubusercontent.com/robotpy/examples/refs/heads/main/ArcadeDrive/robot.py"
Copy link
Member

Choose a reason for hiding this comment

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

Obviously, this isn't going to work offline. Probably better to do this download with the hatchling wheel build?

Copy link
Member

Choose a reason for hiding this comment

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

... lol, I just saw my comment below. I guess I could go either way.

Copy link
Author

Choose a reason for hiding this comment

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

Ha. Yea, target was for this to get something meaningful in robot.py during init - if there's internet we can yoink from the minimal example. If there isn't, fallback is to be same as today (presumably the first-time build will fail anyway unless they get some internet).

Perhaps a more useful fallback is to put the URL they go to for finding some initial robot code?

And/or, address the initial docs question a different way (like how it said, just put a hello world into the docs).

Then again, if we were to hardcode a hello world into the docs for python, why not just hardcode it here?

If I had to pick I think I'd want to keep as is (presuming most folks will have internet when they run robotpy init) and make the fallback just indicate the URL to get code from?

Copy link
Member

Choose a reason for hiding this comment

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

That sounds good to me.

The only challenge will be to remember to update the branch name if we have a different set of examples for 2027.

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

Successfully merging this pull request may close these issues.

2 participants