Skip to content

Commit

Permalink
fix(freeze.py): Skip current directory through freeze and not vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
gutsytechster committed Mar 28, 2020
1 parent ecb8bae commit 69bf2d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
9 changes: 8 additions & 1 deletion src/pip/_internal/commands/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from __future__ import absolute_import

import os
import sys

from pip._internal.cache import WheelCache
Expand Down Expand Up @@ -83,12 +84,18 @@ def run(self, options, args):

cmdoptions.check_list_path_option(options)

paths = options.path
# Filter sys.path, to avoid listing distributions from
# current directory
if paths is None:
paths = [item for item in sys.path if item and item != os.getcwd()]

freeze_kwargs = dict(
requirement=options.requirements,
find_links=options.find_links,
local_only=options.local,
user_only=options.user,
paths=options.path,
paths=paths,
skip_regex=options.skip_requirements_regex,
isolated=options.isolated_mode,
wheel_cache=wheel_cache,
Expand Down
2 changes: 0 additions & 2 deletions src/pip/_vendor/pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,6 @@ def __init__(self, entries=None):

if entries is None:
entries = sys.path
if '' in entries:
entries.remove('')

for entry in entries:
self.add_entry(entry)
Expand Down
13 changes: 0 additions & 13 deletions tools/automation/vendoring/patches/pkg_resources.patch

This file was deleted.

0 comments on commit 69bf2d3

Please sign in to comment.