<commit_before>"""Increments the pyharness version and pushes a new release to PyPI.

This script can only be called by pyharness core committers, and will result
in permission errors otherwise.

Adapted from https://github.com/unlimitedlabs/orchestra/blob/master/release.py.
"""
from argparse import ArgumentParser
from distutils.version import StrictVersion
import os
import re
import shutil
from subprocess import check_output, CalledProcessError
from tempfile import mkdtemp

VERSION_RE = re.compile("__version__ = ['\"]([^'\"]+)['\"]")
PACKAGE_NAME = 'pyharness'
PACKAGE_REPO = 'github.com/thisisdhaas/pyharness'

def main(args):
    # Compute the new version number
    old_version = get_version(PACKAGE_NAME)
    new_version = increment_version_number(old_version, args.version_part)

    # Verify that our git setup is reasonable and print a loud warning.
    verify_and_warn(old_version, new_version, args)

    # Update __init__.py with the new version
    if args.no_commit:
        print('--no-commit passed, not committing new version to {}.'
              .format(PACKAGE_NAME))
        release_version = old_version
        version_text = 'current'
    else:
        update_version(PACKAGE_NAME, new_version, fake=args.fake)
        release_version = new_version
        version_text = 'new'

        # Commit the update to the repo
        commit_and_push(fake=args.fake)

    # Create a new tag for the release
    if args.no_tag:
        print('--no-tag passed, not tagging the {} version.'.format(
            version_text))
        tag_str = 'v{}'.format(release_version)
    else:<commit_msg>Fixes a github url in release.py.<commit_after>"""Increments the pyharness version and pushes a new release to PyPI.

This script can only be called by pyharness core committers, and will result
in permission errors otherwise.

Adapted from https://github.com/unlimitedlabs/orchestra/blob/master/release.py.
"""
from argparse import ArgumentParser
from distutils.version import StrictVersion
import os
import re
import shutil
from subprocess import check_output, CalledProcessError
from tempfile import mkdtemp

VERSION_RE = re.compile("__version__ = ['\"]([^'\"]+)['\"]")
PACKAGE_NAME = 'pyharness'
PACKAGE_REPO = 'https://github.com/thisisdhaas/pyharness'

def main(args):
    # Compute the new version number
    old_version = get_version(PACKAGE_NAME)
    new_version = increment_version_number(old_version, args.version_part)

    # Verify that our git setup is reasonable and print a loud warning.
    verify_and_warn(old_version, new_version, args)

    # Update __init__.py with the new version
    if args.no_commit:
        print('--no-commit passed, not committing new version to {}.'
              .format(PACKAGE_NAME))
        release_version = old_version
        version_text = 'current'
    else:
        update_version(PACKAGE_NAME, new_version, fake=args.fake)
        release_version = new_version
        version_text = 'new'

        # Commit the update to the repo
        commit_and_push(fake=args.fake)

    # Create a new tag for the release
    if args.no_tag:
        print('--no-tag passed, not tagging the {} version.'.format(
            version_text))
        tag_str = 'v{}'.format(release_version)
    else:
{'fraction_non_alphanumeric': 0.08881376767055932, 'fraction_numerical': 0.0, 'mean_word_length': 3.5083102493074794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '7603186', 'n_tokens_mistral': 970, 'n_tokens_neox': 946, 'n_words': 286}