12
12
13
13
import json
14
14
import re
15
- import warnings
16
15
17
16
from testinfra .modules .base import Module
18
17
@@ -58,7 +57,7 @@ def version(self):
58
57
def check (cls , pip_path = "pip" ):
59
58
"""Verify installed packages have compatible dependencies.
60
59
61
- >>> cmd = host.pip_package .check()
60
+ >>> cmd = host.pip .check()
62
61
>>> cmd.rc
63
62
0
64
63
>>> cmd.stdout
@@ -76,7 +75,7 @@ def check(cls, pip_path="pip"):
76
75
def get_packages (cls , pip_path = "pip" ):
77
76
"""Get all installed packages and versions returned by `pip list`:
78
77
79
- >>> host.pip_package .get_packages(pip_path='~/venv/website/bin/pip')
78
+ >>> host.pip .get_packages(pip_path='~/venv/website/bin/pip')
80
79
{'Django': {'version': '1.10.2'},
81
80
'mywebsite': {'version': '1.0a3', 'path': '/srv/website'},
82
81
'psycopg2': {'version': '2.6.2'}}
@@ -106,7 +105,7 @@ def get_packages(cls, pip_path="pip"):
106
105
def get_outdated_packages (cls , pip_path = "pip" ):
107
106
"""Get all outdated packages with current and latest version
108
107
109
- >>> host.pip_package .get_outdated_packages(
108
+ >>> host.pip .get_outdated_packages(
110
109
... pip_path='~/venv/website/bin/pip')
111
110
{'Django': {'current': '1.10.2', 'latest': '1.10.3'}}
112
111
"""
@@ -134,34 +133,3 @@ def get_outdated_packages(cls, pip_path="pip"):
134
133
name , current , latest = _re_match (line , output_re )
135
134
pkgs [name ] = {"current" : current , "latest" : latest }
136
135
return pkgs
137
-
138
-
139
- class PipPackage (Pip ):
140
- """.. deprecated:: 6.2
141
-
142
- Use :class:`~testinfra.modules.pip.Pip` instead.
143
- """
144
-
145
- @staticmethod
146
- def _deprecated ():
147
- """Raise a `DeprecationWarning`"""
148
- warnings .warn (
149
- "Calling host.pip_package is deprecated, call host.pip instead" ,
150
- category = DeprecationWarning ,
151
- stacklevel = 2 ,
152
- )
153
-
154
- @classmethod
155
- def check (cls , pip_path = "pip" ):
156
- PipPackage ._deprecated ()
157
- return super ().check (pip_path = pip_path )
158
-
159
- @classmethod
160
- def get_packages (cls , pip_path = "pip" ):
161
- PipPackage ._deprecated ()
162
- return super ().get_packages (pip_path = pip_path )
163
-
164
- @classmethod
165
- def get_outdated_packages (cls , pip_path = "pip" ):
166
- PipPackage ._deprecated ()
167
- return super ().get_outdated_packages (pip_path = pip_path )
0 commit comments