Allow selection of python version when starting managed Galaxy#874
Allow selection of python version when starting managed Galaxy#874nsoranzo merged 20 commits intogalaxyproject:masterfrom
Conversation
302b226 to
f1b9c9d
Compare
|
Hmm, this is Paste failing now due to deleting from a dict while iterating over it. The fix is simple and I've done it locally, but Paste looks pretty much unmaintained. |
4e963af to
7b9a4b9
Compare
6f4d748 to
a4d78b9
Compare
|
Hmm, so for some reason when installing dependencies by running common_startup.sh we get the wrong shebang (it points to the python in the virtualenv in which planemo was installed), which is a problem for the gunicorn entrypoint. I haven't figured out what's going on there, seems very strange. |
|
So I'm having |
d3b676e to
2394309
Compare
2394309 to
35eb2c1
Compare
48d9807 to
fafb98b
Compare
fafb98b to
c784925
Compare
|
yay, all green! |
05f66a8 to
dbfec70
Compare
@mvdbeek A bugfix for this has been proposed in python/cpython#9516 |
planemo/galaxy/config.py
Outdated
| port=port, | ||
| host=kwds.get("host", "127.0.0.1"), | ||
| server_name=server_name, | ||
| server_name=server_name if float(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) < 3 else 'main', # gunicorn needs main |
There was a problem hiding this comment.
What about:
server_name=server_name if parse_version(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) < parse_version('3') else 'main', # gunicorn needs mainafter adding from pkg_resources import parse_version at the top.
planemo/galaxy/config.py
Outdated
| run_script += " --server-name %s" % shlex_quote(self.server_name) | ||
| server_ini = os.path.join(self.config_directory, "galaxy.ini") | ||
| self.env["GALAXY_CONFIG_FILE"] = server_ini | ||
| if float(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) >= 3: |
There was a problem hiding this comment.
| if float(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) >= 3: | |
| if parse_version(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) >= parse_version('3'): |
planemo/galaxy/config.py
Outdated
| @@ -1240,6 +1254,7 @@ def _install_with_command(ctx, config_directory, command, env, kwds): | |||
| else: | |||
| pip_install_command = "" | |||
There was a problem hiding this comment.
I just noticed that, since commit 9867e56, pip_installs and pip_install_command could be removed, if desired.
planemo/io.py
Outdated
|
|
||
| pid = int(open(pid_file, "r").read()) | ||
| kill_posix(pid) | ||
| os.unlink(pid_file) |
There was a problem hiding this comment.
This should probably be in a try/except Exception: pass, since the killed process can remove the pid file before exiting, in which case os.remove would raise OSError or FileNotFoundError.
|
Thanks @mvdbeek! Should we enable this for tools-iuc testing? 😈 |
|
Sure! We can start with a blacklist and work our way down like we did with condafying tools. |
Otherwise the `pid_file` is set to the wrong filename, preventing `LocalGalaxyConfig.kill()` from working when running Galaxy under Python 3. Follow-up to galaxyproject#874 .
Make sure python 3 is on PATH and enjoy
planemo {test, serve} --galaxy_branch release_18.09 --galaxy_python_version 3.