WRI-Cities / static-GTFS-manager

GUI interface for creating, editing, exporting of static GTFS data for a public transit authority
GNU General Public License v3.0
147 stars 46 forks source link

heroku deployment egg_info bug #76

Closed answerquest closed 6 years ago

answerquest commented 6 years ago

This error had popped up earlier and popped up again recently.

remote: -----> Python app detected
remote:  !     The latest version of Python 3 is python-3.6.5 (you are using python-3.6.4, which is unsupported).
remote:  !     We recommend upgrading by specifying the latest version (python-3.6.5).
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing requirements with pip
remote:        Collecting tornado==5.0.2 (from -r /tmp/build_20cccfb2326b79af83625387b8940a07/requirements.txt (line 2))
remote:          Downloading https://files.pythonhosted.org/packages/cf/d1/3be271ae5eba9fb59df63c9891fdc7d8044b999e8ac145994cdbfd2ae66a/tornado-5.0.2.tar.gz (506kB)
remote:            Complete output from command python setup.py egg_info:
remote:            /app/.heroku/python/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'install_requires'
remote:              warnings.warn(msg)
remote:            /app/.heroku/python/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
remote:              warnings.warn(msg)
remote:            usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
remote:               or: -c --help [cmd1 cmd2 ...]
remote:               or: -c --help-commands
remote:               or: -c cmd --help
remote:            
remote:            error: invalid command 'egg_info'
remote:            
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-z4g5q15a/tornado/
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to lit-mesa-97724.
remote: 
To https://git.heroku.com/lit-mesa-97724.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/lit-mesa-97724.git'

It was unexpected because there had been no problem till just 2 weeks back, and there hadn't been any drastic changes either.
Learned from this stackoverflow post, Heroku push: invalid command error 'egg_info',
that the problem wasn't with tornado. (oops, I had created an issue in tornado repo by then: https://github.com/tornadoweb/tornado/issues/2384)

It was with the non-specified python version. We have to have another file named runtime.txt to tell heroku the specific python version. So, created a file runtime.txt with content:
python-3.6.5

And with that the problem seems to be fixed.

remote: -----> Python app detected
remote: -----> Found python-3.6.4, removing
remote: -----> Installing python-3.6.5
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote:        Collecting xmltodict==0.11.0 (from -r /tmp/build_08d763a6a8b985ba25c293d777687821/requirements.txt (line 1))
remote:          Downloading 
...
remote:        Installing collected packages: xmltodict, tornado, tinydb, six, python-dateutil, pytz, numpy, pandas
remote:          Running setup.py install for tornado: started
remote:            Running setup.py install for tornado: finished with status 'done'
remote:        Successfully installed numpy-1.14.3 pandas-0.22.0 python-dateutil-2.7.2 pytz-2018.4 six-1.11.0 tinydb-3.9.0 tornado-5.0 xmltodict-0.11.0
remote: 
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote: 
remote: -----> Compressing...
remote:        Done: 86.6M
remote: -----> Launching...
remote:        Released v34
remote:        https://lit-mesa-97724.herokuapp.com/ deployed to Heroku
remote: 
remote: Verifying deploy... done.

So, for making the program deployable on heroku, following files are there: