-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6325 from mvdbeek/py3_fixes2
Add py34-first_startup to Travis and default tox tests
- Loading branch information
Showing
18 changed files
with
84 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,43 @@ | ||
""" | ||
If the current installed python version is not 2.7, prints an error | ||
If the current installed Python version is not supported, prints an error | ||
message to stderr and returns 1 | ||
""" | ||
from __future__ import print_function | ||
|
||
import os | ||
import sys | ||
|
||
version_string = '.'.join(str(_) for _ in sys.version_info[:3]) | ||
|
||
msg = """ERROR: Your Python version is: %s | ||
Galaxy is currently supported on Python 2.7 only. To run Galaxy, | ||
please download and install a supported version from python.org. If a | ||
supported version is installed but is not your default, getgalaxy.org | ||
contains instructions on how to force Galaxy to use a different version.""" % sys.version[:3] | ||
Galaxy is currently supported on Python 2.7 only. To run Galaxy, please | ||
install a supported Python version. If a supported version is already | ||
installed but is not your default, https://galaxyproject.org/admin/python/ | ||
contains instructions on how to force Galaxy to use a different version.""" % version_string | ||
|
||
msg_beta = """WARNING: Your Python version is: %s | ||
Galaxy is currently supported on Python 2.7 only, support for Python >= 3.4 | ||
is still in beta stage. Since you are using a virtual environment, we assume | ||
you are developing or testing Galaxy under Python 3. If not, | ||
install a supported Python version. If a supported version is already | ||
installed but is not your default, https://galaxyproject.org/admin/python/ | ||
contains instructions on how to force Galaxy to use a different version.""" % version_string | ||
|
||
|
||
def check_python(): | ||
try: | ||
assert sys.version_info[:2] == (2, 7) | ||
except AssertionError: | ||
venv = os.getenv('VIRTUAL_ENV') | ||
if sys.version_info[:2] == (2, 7): | ||
# supported | ||
return | ||
elif sys.version_info[:2] >= (3, 4) and venv: | ||
print(msg_beta, file=sys.stderr) | ||
else: | ||
print(msg, file=sys.stderr) | ||
raise | ||
raise Exception(msg) | ||
|
||
|
||
if __name__ == '__main__': | ||
rval = 0 | ||
try: | ||
check_python() | ||
except Exception: | ||
rval = 1 | ||
sys.exit(rval) | ||
except Exception as e: | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.