invirtualenv.package module

Functions for managing packaging

invirtualenv.package.install_prereq_packages(test=False)

Install packages required to build python

Parameters:test (bool, optional) – Don’t run the actual command, if True
invirtualenv.package.latest_package_version(package)

Get the latest version number for a package

Parameters:package (str) – Package to get the latest version of
Returns:Latest package version or an empty string if no versions are found
Return type:str
invirtualenv.package.package_scripts_directory()

Get the package scripts directory

Returns str

The path to the directory containing the package scripts
invirtualenv.package.package_versions(package, pypi_url=None)

Get all versions of a package from pypi

Parameters:
  • package (str) – The python package to search for
  • pypi_url (str, optional) – The pypi URL to send the request to, defaults to the production pypi endpoint.
Returns:

A list of all packages found on pypi. The list will be empty if there were no versions found.

Return type:

list

invirtualenv.package.strip_from_end(text, suffix)

Strip a substring from the end of a string

Parameters:
  • text (str) – The string to be evaluated
  • suffix (str) – The suffix or substring to remove from the end of the text string
Returns:

A string with the substring removed if it was found at the end of the string.

Return type:

str