diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-03-23 10:24:35 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-03-26 15:55:18 +0900 |
commit | a27c56a0542388f3d2390a9f013ba21b99c854b0 (patch) | |
tree | 506c744ea5acf0030bb140f1a16a7c1e8a3eab3b | |
parent | e6773539b546576c13f7397769d2001c46bbfdaa (diff) |
utils: Remove "parse_requirements" function
This patch removes unused function "parse_requirements" in order to
avoid using "pip" as a Python library.
Note: Officially "from pip import req as pip_req" is not supported usage
of "pip".
Reported-by: Katsaounis Molyvas Stamatios <mokats@intracom-telecom.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/utils.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/ryu/utils.py b/ryu/utils.py index 8bfdf7da..ca14c12c 100644 --- a/ryu/utils.py +++ b/ryu/utils.py @@ -126,34 +126,3 @@ def binary_str(data): """ # convert data into bytearray explicitly return ''.join('\\x%02x' % byte for byte in bytearray(data)) - - -def parse_requirements(requirements_files=None): - """ - Parses requirements files and returns a list of requirements. - - Returned list would be like:: - - ['foo', 'bar>=X.X', ...] - - :param requirements_files: List of requirements files. The default - is ['requirements.txt', 'tools/pip-requires']. - :return: List of requirements. - """ - from pip import req as pip_req - from pip.download import PipSession - - requirements_files = requirements_files or [ - 'requirements.txt', - 'tools/pip-requires', - ] - - requirements = [] - for f in requirements_files: - if not os.path.isfile(f): - continue - - for r in pip_req.parse_requirements(f, session=PipSession()): - requirements.append(str(r.req)) - - return requirements |