Meilix Generator is a webapp uses flask with Python, Werkzeug, and Jinja 2. It triggers Travis to release in an ISO. It is deployed on Heroku. An older python version caused the webapp to load very slowly and it also become unsupported so there was a need to update the python version. In this blog post we walk through the update of Python in the project.
We can specify an explicit version of Python to be used to run your application. For example, if you require Python 2, add the following to your Pipfile:
Then run $ pipnv lock to generate Pipfile.lock and push to Heroku.
If we are using pip, we can supply a runtime.txt file.
Building of the webapp (Example)
The webapp build in Heroku and provide us a log. The log presents the packages installed and its version. Log also shows if any newer version is present for the package.
While building webapp, we get this as a log:
This confirms that we need to update python version and so thus we edited the runtime.txt
Now building the same webapp, we get:
It already using older python, so it need first to remove the older version and then it install the latest one.
The same implementation can be seen in the history.