Skip to content

Commit

Permalink
Python 2 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
dvershinin committed Jan 3, 2020
1 parent 589b59d commit 562c708
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pip_safe/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.2"
__version__ = "0.0.3"
20 changes: 12 additions & 8 deletions pip_safe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,18 @@ def install_package(name, system_wide=False):


def list_packages():
user_package_names = next(os.walk(get_venvs_dir()))[1]
user_packages = [['Package', 'Version']]
for pkg_name in user_package_names:
current_version = get_current_version(pkg_name)
user_packages.append([pkg_name, current_version])
print(
tabulate(user_packages, headers="firstrow")
)
if not os.path.exists(get_venvs_dir()):
log.info('No packages installed for this user.')
log.info('Run pip-safe install ... maybe?')
else:
user_package_names = next(os.walk(get_venvs_dir()))[1]
user_packages = [['Package', 'Version']]
for pkg_name in user_package_names:
current_version = get_current_version(pkg_name)
user_packages.append([pkg_name, current_version])
print(
tabulate(user_packages, headers="firstrow")
)


def is_bin_in_path(system_wide=False):
Expand Down
2 changes: 0 additions & 2 deletions pip_safe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import os
import tempfile

from importlib_metadata import IsADirectoryError


def make_sure_path_exists(path):
try:
Expand Down

0 comments on commit 562c708

Please sign in to comment.