robotpy / robotpy-installer

RobotPy installer program
MIT License
5 stars 11 forks source link

More deploy updates #98

Closed virtuald closed 7 months ago

virtuald commented 7 months ago

This is neat because the fix for 80 allows you to add things like this in pyproject.toml to indicate that you want something installed on or off robot:

requires = [
    "robotpy-opencv; platform_machine == 'roborio'",
    "opencv-python; platform_machine != 'roborio'"
]

This also fixes the robotpy_extras stuff such that if you delete an item from the list or add an item from the list it will notice and install the correct requirements now.

Finally, this has a dangerous thing that uninstalls everything from the rio if an install is going to happen on deploy. It's correct, and we check to see if the user has stuff in their cache so it shouldn't break the rio... but really I'd rather only uninstall the things that aren't in the user's requirements... but we'd have to do a full dependency resolving which sounds really obnoxious and error-prone.

... though, we could write a script that does it on the rio, instead of trying to figure it out by inspecting wheels. That might not be too bad?

auscompgeek commented 7 months ago

but really I'd rather only uninstall the things that aren't in the user's requirements... but we'd have to do a full dependency resolving which sounds really obnoxious and error-prone.

... though, we could write a script that does it on the rio, instead of trying to figure it out by inspecting wheels. That might not be too bad?

Given that deploys now take a while due to the whole dependency install process, I'm not a fan of having to wait to reinstall everything, rather than only the packages that have changed.

virtuald commented 7 months ago

In theory the deploy process shouldn't take much longer on average -- it should only be installing when the dependencies change (which I think this PR addresses the rest of the issues with doing that), otherwise the deploy process should only be slightly longer than it used to be.

The problem is that we can't reliably know which packages have changed.

I was thinking about it, and I'm still uncomfortable with uninstalling everything. I think the user should have to confirm it before we do it, that way it doesn't take them by surprise and break them.