<commit_before>#!/usr/bin/env python

from setuptools import setup, find_packages
import os
import zipfile
import urllib.request
import sys
import shutil
import logging

def install_apsw():
    try:
        import apsw
        return
    except:
        pass

    print("downloading apsw.")
    urllib.request.urlretrieve('https://github.com/rogerbinns/apsw/archive/3.8.7.3-r1.zip', 'apsw-3.8.7.3-r1.zip')

    print("extracting.")
    with zipfile.ZipFile('apsw-3.8.7.3-r1.zip', 'r') as zip_file:
        zip_file.extractall()

    executable = sys.executable
    if executable is None:
        executable = "python"

    print("install apsw.")
    install_command = ('cd apsw-3.8.7.3-r1 && {executable} '
      'setup.py fetch --version=3.8.7.3 --all build '
      '--enable-all-extensions install'.format(executable=executable)
    )
    os.system(install_command)

    print("clean files.")
    shutil.rmtree('apsw-3.8.7.3-r1')
    os.remove('apsw-3.8.7.3-r1.zip')

def install_serpent():
    print("downloading serpent.")
    urllib.request.urlretrieve('https://github.com/ethereum/serpent/archive/master.zip', 'serpent.zip')

    print("extracting.")
    with zipfile.ZipFile('serpent.zip', 'r') as zip_file:
        zip_file.extractall()

    print("making serpent.")
    os.system('cd serpent-master && make')
    print("install serpent using sudo.")
    print("hence it might request a password.")
    os.system('cd serpent-master && sudo make install')

    print("clean files.")
    shutil.rmtree('serpent-master')
    os.remove('serpent.zip')

required_packages = [
    'appdirs==1.4.0',
    'prettytable==0.7.2',
    'python-dateutil==2.2',
    'flask==0.10.1',
    'json-rpc==1.7',
    'pytest==2.6.3',
    'pycoin==0.52',
    'requests==2.4.2',
    'Flask-HTTPAuth==2.3.0',
    'tornado==4.0.2',
    'pycrypto>=2.6.1',
    'tendo==0.2.6',
    'pysha3==0.3',
    'pytest-cov==1.8.0',
    'colorlog==2.4.0',
    'python-bitcoinlib==0.2.1'
]

setup_options = {
    'name': 'counterparty-lib',
    'version': '9.49.3',
    'author': 'Counterparty Foundation',
    'author_email': '<EMAIL>',
    'maintainer': '<NAME>',
    'maintainer_email': '<EMAIL>',
    'url': 'http://counterparty.io',
    'license': 'MIT',
    'description': 'Reference implementation of the Counterparty protocol',
    'long_description': '',
    'keywords': 'counterparty, bitcoin',<commit_msg>rc3 in `setup.py`<commit_after>#!/usr/bin/env python

from setuptools import setup, find_packages
import os
import zipfile
import urllib.request
import sys
import shutil
import logging

def install_apsw():
    try:
        import apsw
        return
    except:
        pass

    print("downloading apsw.")
    urllib.request.urlretrieve('https://github.com/rogerbinns/apsw/archive/3.8.7.3-r1.zip', 'apsw-3.8.7.3-r1.zip')

    print("extracting.")
    with zipfile.ZipFile('apsw-3.8.7.3-r1.zip', 'r') as zip_file:
        zip_file.extractall()

    executable = sys.executable
    if executable is None:
        executable = "python"

    print("install apsw.")
    install_command = ('cd apsw-3.8.7.3-r1 && {executable} '
      'setup.py fetch --version=3.8.7.3 --all build '
      '--enable-all-extensions install'.format(executable=executable)
    )
    os.system(install_command)

    print("clean files.")
    shutil.rmtree('apsw-3.8.7.3-r1')
    os.remove('apsw-3.8.7.3-r1.zip')

def install_serpent():
    print("downloading serpent.")
    urllib.request.urlretrieve('https://github.com/ethereum/serpent/archive/master.zip', 'serpent.zip')

    print("extracting.")
    with zipfile.ZipFile('serpent.zip', 'r') as zip_file:
        zip_file.extractall()

    print("making serpent.")
    os.system('cd serpent-master && make')
    print("install serpent using sudo.")
    print("hence it might request a password.")
    os.system('cd serpent-master && sudo make install')

    print("clean files.")
    shutil.rmtree('serpent-master')
    os.remove('serpent.zip')

required_packages = [
    'appdirs==1.4.0',
    'prettytable==0.7.2',
    'python-dateutil==2.2',
    'flask==0.10.1',
    'json-rpc==1.7',
    'pytest==2.6.3',
    'pycoin==0.52',
    'requests==2.4.2',
    'Flask-HTTPAuth==2.3.0',
    'tornado==4.0.2',
    'pycrypto>=2.6.1',
    'tendo==0.2.6',
    'pysha3==0.3',
    'pytest-cov==1.8.0',
    'colorlog==2.4.0',
    'python-bitcoinlib==0.2.1'
]

setup_options = {
    'name': 'counterparty-lib',
    'version': '9.49.4rc3',
    'author': 'Counterparty Foundation',
    'author_email': '<EMAIL>',
    'maintainer': '<NAME>',
    'maintainer_email': '<EMAIL>',
    'url': 'http://counterparty.io',
    'license': 'MIT',
    'description': 'Reference implementation of the Counterparty protocol',
    'long_description': '',
    'keywords': 'counterparty, bitcoin',
{'fraction_non_alphanumeric': 0.18355359765051396, 'fraction_numerical': 0.03608139290958674, 'mean_word_length': 3.054421768707483, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 14, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1383638', 'n_tokens_mistral': 1812, 'n_tokens_neox': 1771, 'n_words': 295}