vpip.pypi

Check update from pypi.org.

class vpip.pypi.UpdateResult(compatible, latest)

Bases: tuple

Create new instance of UpdateResult(compatible, latest)

compatible

Alias for field number 0

latest

Alias for field number 1

vpip.pypi.check_update(pkg, curr_version)

Check update from pypi and return the result if there is an update available.

Parameters:
  • pkg (str) – Package name.

  • curr_version (str) – Installed version of the package.

Return type:

UpdateResult or None

UpdateResult has two properies, compatible and latest, which are two different version string.

If result.compatible is not None, it must be compatible with curr_version and must lager than curr_version.

If result.latest is not None, it must larger than result.compatible and curr_version.

vpip.pypi.get_session()

Return a static requests.Session object used by check_update(), so they can share a persistent connection.

vpip.pypi.is_compatible(version: Version, new_version: Version) bool

Check if two versions are compatible. new_version may be smaller than version.

vpip.pypi.parse_version(s: str)