Python 3.10 and environment re-building

I think I’m missing something gross so the question might look silly.
In one of my apps I have chosen Python 3.10 Minimal.
Then I have added a custom package, a long time ago, without specifying the version, so to hook the latest.
Now I see the env is “Built” but:

  1. the library used is 0.7.0 while the latest is now 0.9.0: shouldn’t the env be rebuilt automatically after some time?
  2. there is no indication of the time when that env was built
  3. there is no way to “re-build” ? Should I add another package and remove it “just to force” a rebuild?

Thanks and BR

Requiring the “latest” version can be a trap for that very reason. In this case, nothing has prompted anvil to rebuild your image (we can’t just rebuild every image every few days just in case things have changed - our poor build servers would keel over!).

It’s generally a good idea to specify the version in your requirements - that way, you upgrade explicitly, when you want to, rather than at whatever arbitrary time a rebuild is triggered. (This is also true for a requirements.txt in a traditional Python project - if you specify latest, or don’t specify a version, it might work fine on your machine but someone else setting up on a new machine might get a newer version and therefore unexpected behaviour!)

4 Likes