robotpy / robotpy-installer

RobotPy installer program
MIT License
5 stars 11 forks source link

[BUG]: installer should delete all packages before deploy #82

Closed virtuald closed 7 months ago

virtuald commented 8 months ago

Problem description

I did an upgrade, and..

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
robotpy-cscore 2024.0.0b4 requires pyntcore==2024.0.0b4, but you have pyntcore 2024.1.1.0 which is incompatible.
robotpy-cscore 2024.0.0b4 requires robotpy-wpinet==2024.0.0b4, but you have robotpy-wpinet 2024.1.1.0 which is incompatible.
robotpy-cscore 2024.0.0b4 requires robotpy-wpiutil==2024.0.0b4, but you have robotpy-wpiutil 2024.1.1.0 which is incompatible.
Successfully installed pyntcore-2024.1.1.0 robotpy robotpy-cli-2024.0.0 robotpy-hal-2024.1.1.0 robotpy-wpilib-utilities-2024.0.0 robotpy-wpimath-2024.1.1.0 robotpy-wpinet-2024.1.1.0 robotpy-wpiutil-2024.1.1.0 wpilib-2024.1.1.0

The problem is that my new project was just robotpy, and not cscore... so I'm left in a mostly broken state (well, if I use those packages anyways).

I think when the deploy process detects that things are out of sync, it should just delete all of the existing packages (except pip) and install them fresh (or maybe it's a setting? or it asks the user). The user should have done a sync before hand anyways, so it shouldn't fail?

The risk is that if it deletes everything, the user could be left with an unusable system if the install doesn't succeed, but I don't think there's any reasonable way we can avoid that given the disk space constraints on the rio.

Operating System

RoboRIO

Installed Python Packages

No response

Reproducible example code

No response

virtuald commented 8 months ago

I guess if we scanned the cache for dependencies and they're present that would be a good enough safety check?