tidy3d
tidy3d copied to clipboard
add python client upgrade message
Link to #171
What I rather imagine is that the response is a list of supported versions. If the user version is not the latest, then print the warning suggesting an upgrade. If the user version is not in the list at all, then either warn that the version is deprecated, or maybe even raise an error.
@momchil-flex backend has been deployed to uat, a few assumptions:
- AppName in app-versions is tidy3d-python-client
- the versions for this AppName is senmantic, eg: 1.2.1
I pushed a commit rewording the messages a bit, and using log.warning instead of print. There are still a few things that need to be ironed out. I think it is OK if we postpone this feature to the next release if higher-priority ones need attention.
- [ ] This worked for me on uat, but on preprod nothing happens as it requires authentication.
- [ ] The list of supported versions that I get is 1.2.0 and 1.2.1. Where is this list coming from? Why are 1.1.x not there? How can we add versions to the list as we release them?
- [ ] The warning message says to pip upgrade tidy3d, but currently the package name is tidy3d-beta. It will be converted to tidy3d at some point soon-ish.
I agree that this can be postponed until next release until we work out the more urgent issues.
My only initial comment (have not tested) is how we want to proceed if the try statement fails. I dont think we ever want to try: except without any action if try failed.
Could just print a warning "Could not verify version".
yea I think that would be ok, let's add a warning there.
- [ ] This worked for me on uat, but on preprod nothing happens as it requires authentication.
- [ ] The list of supported versions that I get is 1.2.0 and 1.2.1. Where is this list coming from? Why are 1.1.x not there? How can we add versions to the list as we release them?
- [ ] The warning message says to pip upgrade tidy3d, but currently the package name is tidy3d-beta. It will be converted to tidy3d at some point soon-ish.
- It has been promoted to Prod.
- The version information is from table app-versions, you can update it from https://admin.simulation.cloud/moduleversions, the app name is: tidy3d-python-frontend
- Revised.
Let's get this in 2.0. Still a few to dos:
- [ ] Move tidy3d-beta package to tidy3d on PyPI (not technically the goal of this PR, but otherwise we need to change the message here)
- [ ] Add all the versions with their active/inactive tag on the admin
- [ ] Print a warning if the try: to get the versions fails (warn that couldn't verify version)
note that this currently has web imported into the tidy3d namespace (tidy3d/__init__.py) so it will likely require a login right when tidy3d is imported? Perhaps we should close this issue and figure something else out once the webapi and other components are separated for the 2.0 release?
I'm closing this for now. We can reopen later if we want when we integrate tidy3d-webapi