<commit_before><commit_msg>Added configure-time check and message of supported platform for #48<commit_after>
import sys


"""
Check that we run a supported OS and architecture.
"""

def unsupported():
    print('Unsupported OS/platform.')
    print('See https://github.com/nexB/scancode-toolkit/ for supported OS/platforms.')
    print('Enter a ticket https://github.com/nexB/scancode-toolkit/issues asking for your OS/platform combo.')
    sys.exit(1)

if sys.maxsize > 2 ** 32:
    arch = '64'
else:
    arch = '32'

sys_platform = str(sys.platform).lower()
if 'linux' in sys_platform:
    os = 'linux'
elif'win32' in sys_platform:
    os = 'win'
elif 'darwin' in sys_platform:
    os = 'mac'
else:
    unsupported()


supported_combos = {
    'linux': ['32', '64'],
    'win': ['32',],
    'mac': ['64',],
}

arches = supported_combos[os]
if arch not in arches:
    unsupported()
{'fraction_non_alphanumeric': 0.1506228765571914, 'fraction_numerical': 0.022650056625141562, 'mean_word_length': 3.6526315789473682, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5063838', 'n_tokens_mistral': 316, 'n_tokens_neox': 300, 'n_words': 86}