Skip to content

Commit

Permalink
Replace pip internal functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nezhar committed Mar 20, 2018
1 parent 64da384 commit e812bbf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'requests',
'semantic_version',
'pyopenssl',
'packaging',
]

# Setup configuration
Expand Down Expand Up @@ -93,13 +94,12 @@ def run(self):
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Intended Audience :: Developers',
Expand Down
15 changes: 6 additions & 9 deletions updatable/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# -*- coding: utf-8 -*-
import sys
import re
import argparse
import requests
import semantic_version

from datetime import datetime
from pip.operations import freeze

try:
from packaging.version import parse
except ImportError:
from pip._vendor.packaging.version import parse
from subprocess import check_output
from packaging.version import parse


def get_parsed_environment_package_list():
Expand All @@ -31,10 +28,10 @@ def get_environment_requirements_list():
:return: string
"""
requirement_list = []
requirements = freeze.freeze()
requirements = check_output([sys.executable, '-m', 'pip', 'freeze'])

for requirement in requirements:
requirement_list.append(requirement)
for requirement in requirements.split():
requirement_list.append(requirement.decode("utf-8"))

return requirement_list

Expand Down
3 changes: 1 addition & 2 deletions updatable/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-

__version__ = "0.2.0"
__version__ = "0.3.0"

0 comments on commit e812bbf

Please sign in to comment.