Beispiel #1
0
    def setup_new_build(self):
        """
        Sets the package version number and build tag to match the next
        development build. This will also pin all the versions of the dependencies.
        """
        version = CONFIG.dev_build_number
        tag = DEFAULT_BUILD_TAG

        latest = self.pypi_client.get_last_version(self.distribution.get_name(),
                                                   dev=True, strict=True)
        if not latest:
            log.info("No dev distributions exist yet for %s, using default version %s" % \
                     (self.distribution.get_name(), '%s%s' % (version, tag)))
        else:
            if not (is_strict_dev_version(latest)):
                raise ValueError("Latest version (%s) is not a dev build" % latest)

            build_number = latest.rsplit('dev', 1)[-1]
            tag = '.dev%d' % (int(build_number) + 1)
        log.info("created new build number: %s%s" % (version, tag))
        self.distribution.metadata.version = version
        self.tag_build = tag
        self.pin_requirements()
def test_is_strict_dev_version():
    assert manage.is_strict_dev_version('0.0.dev1')
    assert manage.is_strict_dev_version('0.0.dev4')
    assert not manage.is_strict_dev_version('1.2.3')
    assert not manage.is_strict_dev_version('1.2.3dev4')
    assert not manage.is_strict_dev_version('1.0.0.dev4')