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

"""Packaging script for Robot Framework

Usage:  package.py command version_number [release_tag]

Argument 'command' can have one of the following values:
  - sdist    : create source distribution
  - wininst  : create Windows installer
  - all      : create both packages
  - version  : update only version information in 'src/robot/version.py'
  - jar      : create stand-alone jar file containing RF and Jython

'version_number' must be a version number in format '2.x(.y)', 'trunk' or
'keep'. With 'keep', version information is not updated.

'release_tag' must be either 'alpha', 'beta', 'rc' or 'final', where all but
the last one can have a number after the name like 'alpha1' or 'rc2'. When
'version_number' is 'trunk', 'release_tag' is automatically assigned to the
current date.

When creating the jar distribution, jython.jar must be placed in 'ext-lib'
directory, under the project root.

This script uses 'setup.py' internally. Distribution packages are created
under 'dist' directory, which is deleted initially. Depending on your system,
you may need to run this script with administrative rights (e.g. with 'sudo').

Examples:
  package.py sdist 2.0 final
  package.py wininst keep
  package.py all 2.1.13 alpha
  package.py sdist trunk
  package.py version trunk
"""

from __future__ import with_statement
import sys
import os
from os.path import abspath, dirname, exists, join
import shutil
import re
import time
import subprocess
import zipfile
from glob import glob
import urllib


ROOT_PATH = abspath(dirname(__file__))
DIST_PATH = join(ROOT_PATH, 'dist')
BUILD_PATH = join(ROOT_PATH, 'build')
ROBOT_PATH = join(ROOT_PATH, 'src', 'robot')
JAVA_SRC = join(ROOT_PATH, 'src', 'java', 'org', 'robotframework')
JYTHON_VERSION = '2.5.3'
SETUP_PATH = join(ROOT_PATH, 'setup.py')
BITMAP = join(ROOT_PATH, 'robot.bmp')
INSTALL_SCRIPT = 'robot_postinstall.py'
VERSION_PATH = join(ROBOT_PATH, 'version.py')
POM_PATH = join(ROOT_PATH, 'pom.xml')
VERSIONS = [re.compile('^2\.\d+(\.\d+)?$'), 'trunk', 'keep']
RELEASES = [re.compile('^a\d*$'), re.compile('^b\d*$'),
            re.compile('^rc\d*$'), 'final']
VERSION_CONTENT = """# Automatically generated by 'package.py' script.

import sys

VERSION = '%(version_number)s'
RELEASE = '%(release_tag)s'
TIMESTAMP = '%(timestamp)s'

def get_version(sep=' '):
    if RELEASE == 'final':
        return VERSION
    return VERSION + sep + RELEASE

def get_full_version(who=''):
    sys_version = sys.version.split()[0]
    version = '%%s %%s (%%s %%s on %%s)' \\
        %% (who, get_version(), _get_interpreter(), sys_version, sys.platform)
    return version.strip()<commit_msg>package.py: fixed docs about release tags (we nowadays use 'a' and 'b' and not 'alpha' and 'beta') and changed code to require 'a', 'b', and 'rc' to contain number.<commit_after>#!/usr/bin/env python

"""Packaging script for Robot Framework

Usage:  package.py command version_number [release_tag]

Argument 'command' can have one of the following values:
  - sdist    : create source distribution
  - wininst  : create Windows installer
  - all      : create both packages
  - version  : update only version information in 'src/robot/version.py'
  - jar      : create stand-alone jar file containing RF and Jython

'version_number' must be a version number in format '2.x(.y)', 'trunk' or
'keep'. With 'keep', version information is not updated.

'release_tag' must be either 'a<num>', 'b<num>', 'rc<num>' or 'final', where
'<num>' is an integer like 'a1' or 'rc2'. When 'version_number' is 'trunk',
'release_tag' is automatically assigned to the current date.

When creating the jar distribution, jython.jar must be placed in 'ext-lib'
directory, under the project root.

This script uses 'setup.py' internally. Distribution packages are created
under 'dist' directory, which is deleted initially.

Examples:
  package.py sdist 2.0 final
  package.py wininst keep
  package.py all 2.1.13 a2
  package.py sdist trunk
  package.py version trunk
"""

from __future__ import with_statement
import sys
import os
from os.path import abspath, dirname, exists, join
import shutil
import re
import time
import subprocess
import zipfile
from glob import glob
import urllib


ROOT_PATH = abspath(dirname(__file__))
DIST_PATH = join(ROOT_PATH, 'dist')
BUILD_PATH = join(ROOT_PATH, 'build')
ROBOT_PATH = join(ROOT_PATH, 'src', 'robot')
JAVA_SRC = join(ROOT_PATH, 'src', 'java', 'org', 'robotframework')
JYTHON_VERSION = '2.5.3'
SETUP_PATH = join(ROOT_PATH, 'setup.py')
BITMAP = join(ROOT_PATH, 'robot.bmp')
INSTALL_SCRIPT = 'robot_postinstall.py'
VERSION_PATH = join(ROBOT_PATH, 'version.py')
POM_PATH = join(ROOT_PATH, 'pom.xml')
VERSIONS = [re.compile('^2\.\d+(\.\d+)?$'), 'trunk', 'keep']
RELEASES = [re.compile('^a\d+$'), re.compile('^b\d+$'),
            re.compile('^rc\d+$'), 'final']
VERSION_CONTENT = """# Automatically generated by 'package.py' script.

import sys

VERSION = '%(version_number)s'
RELEASE = '%(release_tag)s'
TIMESTAMP = '%(timestamp)s'

def get_version(sep=' '):
    if RELEASE == 'final':
        return VERSION
    return VERSION + sep + RELEASE

def get_full_version(who=''):
    sys_version = sys.version.split()[0]
    version = '%%s %%s (%%s %%s on %%s)' \\
        %% (who, get_version(), _get_interpreter(), sys_version, sys.platform)
    return version.strip()
{'fraction_non_alphanumeric': 0.13239962651727358, 'fraction_numerical': 0.005415499533146592, 'mean_word_length': 4.448626653102747, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3766931', 'n_tokens_mistral': 1791, 'n_tokens_neox': 1758, 'n_words': 582}