<commit_before>"""
This script will walk a developer through the process of cutting a release.

Based on https://bitbucket.org/cherrypy/cherrypy/wiki/ReleaseProcess

To cut a release, simply invoke this script at the changeset to be released.
"""

from __future__ import print_function

import subprocess
import sys
import os
import platform
import shutil
import importlib

VERSION='3.2.4'

if sys.version_info < (3,):
	input = raw_input

def get_next_version():
	print("The last release on this branch was {version}".format(
		version=VERSION))
	return input("What version are you releasing? ")

NEXT_VERSION = get_next_version()

files_with_versions = ('release.py', 'setup.py', 'cherrypy/__init__.py',
	'cherrypy/wsgiserver/wsgiserver2.py',
	'cherrypy/wsgiserver/wsgiserver3.py',
)

def check_wheel():
	"""
	Ensure 'wheel' is installed (required for bdist_wheel).
	"""
	try:
		importlib.import_module('wheel')
	except ImportError:
		print("CherryPy requires 'wheel' be installed to produce wheels.",
			file=sys.stderr)
		raise SystemExit(5)

def check_status():
	"""
	Make sure there aren't outstanding changesets that are unpushed, maybe
	run the tests or ask the user if the tests are passing.
	"""
	print("You're about to release CherryPy {NEXT_VERSION}".format(
		**globals()))
	res = input('Have you run the tests with `nosetests -s ./` on '
		'Windows, Linux, and Mac on at least Python 2.4, 2.5, 2.7, and 3.2? '
		.format(**globals()))
	if not res.lower().startswith('y'):
		print("Please do that")
		raise SystemExit(1)

def bump_versions():
	"""
	Bump the versions in each of the places where it appears and commit.
	"""
	list(map(bump_version, files_with_versions))

	subprocess.check_call(['hg', 'ci', '-m',
		'Bumped to {NEXT_VERSION} in preparation for next '
		'release.'.format(**globals())])


def bump_version(filename):
	with open(filename, 'rb') as f:
		b_version = VERSION.encode('ascii')
		b_next_version = NEXT_VERSION.encode('ascii')
		lines = [line.replace(b_version, b_next_version) for line in f]
	with open(filename, 'wb') as f:
		f.writelines(lines)

def tag_release():
	"""
	Tag the release.
	"""
	subprocess.check_call(['hg', 'tag', NEXT_VERSION])

dist_commands = [
	['sdist', 'bdist_wininst', 'bdist_wheel'],
]

def build():
	if os.path.isfile('MANIFEST'):
		os.remove('MANIFEST')<commit_msg>Correct declaration of dist commands<commit_after>"""
This script will walk a developer through the process of cutting a release.

Based on https://bitbucket.org/cherrypy/cherrypy/wiki/ReleaseProcess

To cut a release, simply invoke this script at the changeset to be released.
"""

from __future__ import print_function

import subprocess
import sys
import os
import platform
import shutil
import importlib

VERSION='3.2.4'

if sys.version_info < (3,):
	input = raw_input

def get_next_version():
	print("The last release on this branch was {version}".format(
		version=VERSION))
	return input("What version are you releasing? ")

NEXT_VERSION = get_next_version()

files_with_versions = ('release.py', 'setup.py', 'cherrypy/__init__.py',
	'cherrypy/wsgiserver/wsgiserver2.py',
	'cherrypy/wsgiserver/wsgiserver3.py',
)

def check_wheel():
	"""
	Ensure 'wheel' is installed (required for bdist_wheel).
	"""
	try:
		importlib.import_module('wheel')
	except ImportError:
		print("CherryPy requires 'wheel' be installed to produce wheels.",
			file=sys.stderr)
		raise SystemExit(5)

def check_status():
	"""
	Make sure there aren't outstanding changesets that are unpushed, maybe
	run the tests or ask the user if the tests are passing.
	"""
	print("You're about to release CherryPy {NEXT_VERSION}".format(
		**globals()))
	res = input('Have you run the tests with `nosetests -s ./` on '
		'Windows, Linux, and Mac on at least Python 2.4, 2.5, 2.7, and 3.2? '
		.format(**globals()))
	if not res.lower().startswith('y'):
		print("Please do that")
		raise SystemExit(1)

def bump_versions():
	"""
	Bump the versions in each of the places where it appears and commit.
	"""
	list(map(bump_version, files_with_versions))

	subprocess.check_call(['hg', 'ci', '-m',
		'Bumped to {NEXT_VERSION} in preparation for next '
		'release.'.format(**globals())])


def bump_version(filename):
	with open(filename, 'rb') as f:
		b_version = VERSION.encode('ascii')
		b_next_version = NEXT_VERSION.encode('ascii')
		lines = [line.replace(b_version, b_next_version) for line in f]
	with open(filename, 'wb') as f:
		f.writelines(lines)

def tag_release():
	"""
	Tag the release.
	"""
	subprocess.check_call(['hg', 'tag', NEXT_VERSION])

dist_commands = ['sdist', 'bdist_wininst', 'bdist_wheel']

def build():
	if os.path.isfile('MANIFEST'):
		os.remove('MANIFEST')
{'fraction_non_alphanumeric': 0.1341750481489407, 'fraction_numerical': 0.006847849347314359, 'mean_word_length': 4.901515151515151, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '555788', 'n_tokens_mistral': 1641, 'n_tokens_neox': 1573, 'n_words': 471}