aboutsummaryrefslogtreecommitdiffstats
path: root/release.py
blob: a76d2de4899da35150d1f592d3e31803b1ea4d20 (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
"""
Setuptools is released using 'jaraco.packaging.release'. To make a release,
install jaraco.packaging and run 'python -m jaraco.packaging.release'
"""

import os
import subprocess

import pkg_resources

pkg_resources.require('jaraco.packaging>=2.0')
pkg_resources.require('wheel')


def before_upload():
    BootstrapBookmark.add()


def after_push():
    BootstrapBookmark.push()

files_with_versions = (
    'ez_setup.py', 'setuptools/version.py',
)

# bdist_wheel must be included or pip will break
dist_commands = 'sdist', 'bdist_wheel'

test_info = "Travis-CI tests: http://travis-ci.org/#!/jaraco/setuptools"

os.environ["SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES"] = "1"

class BootstrapBookmark:
    name = 'bootstrap'

    @classmethod
    def add(cls):
        cmd = ['hg', 'bookmark', '-i', cls.name, '-f']
        subprocess.Popen(cmd)

    @classmethod
    def push(cls):
        """
        Push the bootstrap bookmark
        """
        push_command = ['hg', 'push', '-B', cls.name]
        # don't use check_call here because mercurial will return a non-zero
        # code even if it succeeds at pushing the bookmark (because there are
        # no changesets to be pushed). !dm mercurial
        subprocess.call(push_command)