Added logic to create a default robot.py from the arcade drive examle#145
Added logic to create a default robot.py from the arcade drive examle#145gerth2 wants to merge 1 commit intorobotpy:mainfrom
Conversation
…e, rather than being blank. This should help ensure deployability.
| pass | ||
|
|
||
| def _default_main_file(self, main_file: pathlib.Path)-> None: | ||
| source = "https://raw.githubusercontent.com/robotpy/examples/refs/heads/main/ArcadeDrive/robot.py" |
There was a problem hiding this comment.
Obviously, this isn't going to work offline. Probably better to do this download with the hatchling wheel build?
There was a problem hiding this comment.
... lol, I just saw my comment below. I guess I could go either way.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
We could side-step the 2027 issue by dumping just the TimedRobot skeleton.
Rather than being blank. This should help ensure deployability.