summaryrefslogtreecommitdiff
path: root/release.py
blob: 14af0069b9fa6c8ace63503c519663e4610b6a02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""
Use jaraco.packaging with this script to cut a release. After installing
jaraco.packaging, invoke:

python -m jaraco.packaging.release
"""

from __future__ import print_function

import sys
import os
import shutil
import importlib
import textwrap

files_with_versions = (
    '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 before_upload():
    check_wheel()
    remove_files()

test_info = textwrap.dedent("""
    Run tests with `nosetests -s ./` on Windows, Linux, and Mac on at least
    Python 2.4, 2.5, 2.7, and 3.2.
    """).lstrip()

dist_commands = 'sdist', 'bdist_wheel'


def remove_files():
    if os.path.isfile('MANIFEST'):
        os.remove('MANIFEST')
    if os.path.isdir('dist'):
        shutil.rmtree('dist')


def announce():
    print('Distributions have been uploaded.')
    print('Please ask in IRC for others to help you test this release.')
    print("Please confirm that the distro installs properly "
          "with `easy_install CherryPy=={version}`.".format(**globals()))
    print("Please change the Wiki: Home page (news), CherryPyDownload")
    print("Please announce the release on newsgroups, mailing lists, "
          "and IRC /topic.")