plasmabio / tljh-repo2docker

Plugin for The Littlest JupyterHub to build multiple user environments with repo2docker
BSD 3-Clause "New" or "Revised" License
60 stars 15 forks source link

Await rendered template if neccesary #40

Closed TimoRoth closed 3 years ago

TimoRoth commented 3 years ago

Latest release of jupyterhub made render_template return a coroutine: https://github.com/jupyterhub/jupyterhub/commit/be211a48ef194d1c478dcef2f5afa1bfc9f40541

So it needs to be awaited now, or else self.write throws an error. To keep backwards compatibility, I first check of the result is indeed awaitable. Could also just drop this check and always await it, if assuming the use of the latest version of jupyterhub is fine.

jtpio commented 3 years ago

Thanks a lot @TimoRoth for this, looks good!

I wonder if it would be possible to test with multiple versions of JupyterHub on CI. Maybe that would require adding a new entry in the matrix for the jupyterhub version, and possibly a new step in the workflow?

https://github.com/plasmabio/tljh-repo2docker/blob/master/.github/workflows/test.yml

jtpio commented 3 years ago

Could also just drop this check and always await it, if assuming the use of the latest version of jupyterhub is fine.

We probably want to keep this check for now, since TLJH currently uses 1.2.2:

https://github.com/jupyterhub/the-littlest-jupyterhub/blob/18efee665aebd6c59334685eb9929f823ad649b0/tljh/installer.py#L225