Skip to content

Commit a6b0d23

Browse files
committed
Deprecate the _strip_postfix function
It only happens for editable-non-file URLs and is an undocumented behavior.
1 parent 6ec5597 commit a6b0d23

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

pip/req/req_install.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
)
4242

4343
from pip.utils.hashes import Hashes
44-
from pip.utils.deprecation import RemovedInPip10Warning
44+
from pip.utils.deprecation import RemovedInPip10Warning, RemovedInPip11Warning
4545
from pip.utils.logging import indent_log
4646
from pip.utils.setuptools_build import SETUPTOOLS_SHIM
4747
from pip.utils.ui import open_spinner
@@ -984,6 +984,10 @@ def _strip_postfix(req):
984984
match = re.search(r'^(.*?)(?:-dev|-\d.*)$', req)
985985
if match:
986986
# Strip off -dev, -0.2, etc.
987+
warnings.warn(
988+
"#egg cleanup for editable urls will be dropped in the future",
989+
RemovedInPip11Warning,
990+
)
987991
req = match.group(1)
988992
return req
989993

tests/functional/test_install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def test_download_editable_to_custom_path(script, tmpdir):
152152
result = script.pip(
153153
'install',
154154
'-e',
155-
'%s#egg=initools-dev' %
155+
'%s#egg=initools' %
156156
local_checkout(
157157
'svn+http://svn.colorstudy.com/INITools/trunk',
158158
tmpdir.join("cache")

tests/functional/test_install_reqs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_multiple_requirements_files(script, tmpdir):
8383
other_lib_name, other_lib_version = 'anyjson', '0.3'
8484
script.scratch_path.join("initools-req.txt").write(
8585
textwrap.dedent("""
86-
-e %s@10#egg=INITools-dev
86+
-e %s@10#egg=INITools
8787
-r %s-req.txt
8888
""") %
8989
(

tests/functional/test_install_user.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_install_subversion_usersite_editable_with_distribute(
6161
virtualenv.system_site_packages = True
6262
result = script.pip(
6363
'install', '--user', '-e',
64-
'%s#egg=initools-dev' %
64+
'%s#egg=initools' %
6565
local_checkout(
6666
'svn+http://svn.colorstudy.com/INITools/trunk',
6767
tmpdir.join("cache"),

tests/functional/test_uninstall.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def test_uninstall_editable_from_svn(script, tmpdir):
249249
"""
250250
result = script.pip(
251251
'install', '-e',
252-
'%s#egg=initools-dev' % local_checkout(
252+
'%s#egg=initools' % local_checkout(
253253
'svn+http://svn.colorstudy.com/INITools/trunk',
254254
tmpdir.join("cache"),
255255
),
@@ -320,7 +320,7 @@ def test_uninstall_from_reqs_file(script, tmpdir):
320320
"""
321321
script.scratch_path.join("test-req.txt").write(
322322
textwrap.dedent("""
323-
-e %s#egg=initools-dev
323+
-e %s#egg=initools
324324
# and something else to test out:
325325
PyLogo<0.4
326326
""") %
@@ -337,7 +337,7 @@ def test_uninstall_from_reqs_file(script, tmpdir):
337337
-i http://www.example.com
338338
--extra-index-url http://www.example.com
339339
340-
-e %s#egg=initools-dev
340+
-e %s#egg=initools
341341
# and something else to test out:
342342
PyLogo<0.4
343343
""") %

0 commit comments

Comments
 (0)