How to use the distutils2.version.get_version_predicate function in Distutils2

To help you get started, we’ve selected a few Distutils2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nix-community / pypi2nix / pypi2nix / __init__.py View on Github external
def __str__(self):
        if self.version is None:
            releases = self.pypi.get_releases(
                self.name, show_hidden=True, force_update=True)
            predicate = get_version_predicate(self.name)
            self.version = str(releases.get_last(predicate).version)

        release = self.pypi.get_distributions(self.name, self.version)
        print release.dists['sdist']

        import pdb; pdb.set_trace()

        return TMPL_EXPR % dict(name=self.name)