<commit_before>#! /usr/bin/env python
#
# Copyright (C) 2012 Nuxeo
#

import os
import sys
from datetime import datetime

import nx_esky
from esky.bdist_esky import Executable as es_Executable

OUTPUT_DIR = 'dist'
SERVER_MIN_VERSION = '5.6'


def read_version(init_file):
    with open(init_file, 'rb') as f:
        return f.readline().split("=")[1].strip().replace('\'', '')


def update_version(init_file, version):
    with open(init_file, 'wb') as f:
        f.write("__version__ = '%s'\n" % version)


def create_json_metadata(client_version, server_version):

    output_dir = os.path.abspath(OUTPUT_DIR)<commit_msg>NXP-14388: Allow to use VERSION environment variable to build<commit_after>#! /usr/bin/env python
#
# Copyright (C) 2012 Nuxeo
#

import os
import sys
from datetime import datetime

import nx_esky
from esky.bdist_esky import Executable as es_Executable

OUTPUT_DIR = 'dist'
SERVER_MIN_VERSION = '5.6'


def read_version(init_file):
    if 'VERSION' in os.environ:
        return os.environ['VERSION']
    with open(init_file, 'rb') as f:
        return f.readline().split("=")[1].strip().replace('\'', '')


def update_version(init_file, version):
    with open(init_file, 'wb') as f:
        f.write("__version__ = '%s'\n" % version)


def create_json_metadata(client_version, server_version):

    output_dir = os.path.abspath(OUTPUT_DIR)
{'fraction_non_alphanumeric': 0.13132795304475423, 'fraction_numerical': 0.013939838591342627, 'mean_word_length': 4.3700787401574805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7329825', 'n_tokens_mistral': 493, 'n_tokens_neox': 472, 'n_words': 117}