def test_all_the_right_pips(pip): a = str(pip_api.PIP_VERSION) b = pip_api.version() c = pip.run('--version').split(' ')[1] assert a == b assert b == c
) parser.add_argument( '-p', '--python-version', help='Python version to add wheels for. May be used multiple times.', action='append', default=[], ) parser.add_argument( '--version', help='Version of hashin', action='store_true', default=False, ) major_pip_version = int(pip_api.version().split('.')[0]) if major_pip_version < 8: raise ImportError('hashin only works with pip 8.x or greater') class PackageError(Exception): pass class NoVersionsError(Exception): """When there are no valid versions found.""" def _verbose(*args): print('* ' + ' '.join(args))
from glob import glob from itertools import chain from json import loads from os import devnull from subprocess import check_output from sys import executable from warnings import warn import packaging.utils import packaging.version import pip_api from pkg_resources import get_distribution import pytest max_version = packaging.version.parse("18.1.0") pip_version = packaging.version.parse(pip_api.version()) if pip_version > max_version: warn("Version pip=={} is possibly incompatible, highest " "known compatible version is {}.".format(pip_version, max_version)) __version__ = "0.0.4" DEFAULT_PATTERNS = [ "req*.txt", "req*.pip", "requirements/*.txt", "requirements/*.pip" ] def pytest_configure(config): config.addinivalue_line( "markers", "reqs: check requirements files against what is installed") config.addinivalue_line(
def test_version(pip): from_api = pip_api.version() from_call = pip.run("--version").split()[1] from_import = str(pip_api.PIP_VERSION) assert from_api == from_call == from_import
def test_version(): result = pip_api.version() assert result == str(pip_api.PIP_VERSION)
from glob import glob from itertools import chain from json import loads from os import devnull from subprocess import check_output from sys import executable from warnings import warn import packaging.utils import packaging.version import pip_api from pkg_resources import get_distribution import pytest max_version = packaging.version.parse('18.1.0') pip_version = packaging.version.parse(pip_api.version()) if pip_version > max_version: warn( 'Version pip=={} is possibly incompatible, highest ' 'known compatible version is {}.'.format( pip_version, max_version ) ) __version__ = '0.0.4' DEFAULT_PATTERNS = [ 'req*.txt', 'req*.pip', 'requirements/*.txt', 'requirements/*.pip' ]