-
Notifications
You must be signed in to change notification settings - Fork 11
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 package synchronization mechanism for local/remote python environment #70
Comments
Here's another version of the same idea:
|
Thinking out loud, let me know if I am missing something. There could even be a new "robotpy-installer freeze" command to generate a simple robotpy-requirements.txt file with all robotpy packages. instead of a "download-pyhon" and "download [packages]", it could be simplified by a "download-all" command witch would do both. Once all is downloaded and you are connected to the rio, I would see a simple "robotpy-install install-all" to install python and all packages (again, based on the local versions). If a robotpy package is found on the local computer but not in the downloaded wheel for the rio, an alert could let the user know that they need to run the "download-all" command again. Alternatively, all this could even be more automated using within the "robot.py deploy"
I guess that for most people, having everything in the deploy command would be the best option. |
Thinking through the workflow a user will take from a clean python installation:
Then they make a robot.py, add the [tool.robotpy]
# equivalent to `robotpy==2024.0.0b4`
robotpy_version = "2024.0.0b4"
# equivalent to `robotpy[cscore, ...]`
robotpy_extras = ["cscore"]
# Other pip installable requirement lines
requires = [
"numpy"
]
Ideally, you'd like them to do:
And that would set up their local environment with the correct pip packages, and also download python and all of the packages for roborio. However, at least some of the time the user's robot.py would fail because of a missing import, so I think you'd also have to provide a robotpy-installer command that does the exact same thing but doesn't import robot.py:
User does normal development, and then they do:
Before doing the deploy...
Then it will do the normal deploy stuff. The pip sync is going to be expensive to do, so I think it would make sense to cache the synced list on the rio somewhere so that it can be quickly checked (since most of the time it won't need to be done). Probably should store the resulting pip json after install is finished, assuming there's nothing nondeterministic in there. Probably needs a We would also need to support users that don't have a If
Probably add The synchronization behavior above is likely covered by |
It all does seem to make sense. The only thing I am seeing, is the |
I think it should make a virtualenv and generate a vscode python config. That way packages are project specific like cpp and java |
I would not want to do that by default. I think this could be a separate action |
Fixed in #79 |
Idea is something like this:
Vendors are TBD. Probably makes sense to keep vendors in vendordep jsons and integrate that with this somehow... but maybe not.
Python vscode extension would need to know how to update pyproject.toml to upgrade to a specific wpilib wheel. Might just make sense to have that be an installer command?
The text was updated successfully, but these errors were encountered: