File tree 2 files changed +28
-1
lines changed
2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -540,7 +540,7 @@ def get_distributions(self):
540
540
:rtype: iterator
541
541
"""
542
542
543
- libdirs = self .base_paths ["libdirs" ].split (os .pathsep )
543
+ libdirs = os . environ . get ( 'PIP_TARGET' , self .base_paths ["libdirs" ].split (os .pathsep ) )
544
544
dists = (pkg_resources .find_distributions (libdir ) for libdir in libdirs )
545
545
yield from itertools .chain .from_iterable (dists )
546
546
Original file line number Diff line number Diff line change @@ -111,3 +111,30 @@ def test_sync_sequential_verbose(PipenvInstance):
111
111
c = p .pipenv ('sync --sequential --verbose' )
112
112
for package in p .lockfile ['default' ]:
113
113
assert f'Successfully installed { package } ' in c .stdout
114
+
115
+
116
+ @pytest .mark .sync
117
+ def test_sync_consider_pip_target (PipenvInstance ):
118
+ """
119
+ """
120
+ with PipenvInstance (chdir = True ) as p :
121
+ with open (p .pipfile_path , 'w' ) as f :
122
+ f .write ("""
123
+ [packages]
124
+ six = "*"
125
+ """ .strip ())
126
+
127
+ # Perform initial lock.
128
+ c = p .pipenv ('lock' )
129
+ assert c .returncode == 0
130
+ lockfile_content = p .lockfile
131
+ assert lockfile_content
132
+ c = p .pipenv ('sync' )
133
+ assert c .returncode == 0
134
+
135
+ pip_target_dir = 'target_dir'
136
+ os .environ ['PIP_TARGET' ] = pip_target_dir
137
+ c = p .pipenv ('sync' )
138
+ assert c .returncode == 0
139
+ assert 'six.py' in os .listdir (os .path .join (p .path , pip_target_dir ))
140
+ os .environ .pop ('PIP_TARGET' )
You can’t perform that action at this time.
0 commit comments