Skip to content
This repository was archived by the owner on Aug 8, 2018. It is now read-only.

Check python-version (>=2.7.9) on startup #114

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Notes

Pyethapp runs on Python 2.7. If you don't know how to install an
up-to-date version of Python, have a look
`here <https://wiki.python.org/moin/BeginnersGuide>`__. It is always
advised to install system-dependecies with the help of a package manager
`here <https://wiki.python.org/moin/BeginnersGuide>`__. The minimum required version is ``2.7.9``.
It is always advised to install system-dependecies with the help of a package manager
(e.g. *homebrew* on Mac OS X or *apt-get* on Debian).

Please install a *virtualenv* environment for a comfortable Pyethapp
Expand Down
10 changes: 9 additions & 1 deletion pyethapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
from pyethapp.utils import merge_dict, load_contrib_services, FallbackChoice
import utils

log = slogging.get_logger('app')
# minimum required python version
PY_VERSION = '2.7.9'

log = slogging.get_logger('app')

services = [DBService, AccountsService, NodeDiscovery, PeerManager, ChainService, PoWService,
JSONRPCServer, IPCRPCServer, Console]
Expand Down Expand Up @@ -86,6 +88,12 @@ def app(ctx, profile, alt_config, config_values, alt_data_dir, log_config, boots
# configure logging
slogging.configure(log_config, log_json=log_json, log_file=log_file)

# check if minimum required python version
required_version = tuple(map(int, PY_VERSION.split('.')))
if sys.version_info < required_version:
log.fatal('python version must be at least {}'.format(PY_VERSION))
sys.exit(1)

# data dir default or from cli option
alt_data_dir = os.path.expanduser(alt_data_dir)
data_dir = alt_data_dir or konfig.default_data_dir
Expand Down