diff --git a/CHANGES.txt b/CHANGES.txt index 1ffb42366..218060f31 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,7 @@ -**8.2.0 (unreleased)** +**9.0.0 (unreleased)** + +* **BACKWARD INCOMPATIBLE** Remove the attempted autodetection of requirement + names from URLs, URLs must include a name via `#egg=`. * **DEPRECATION** ``pip install --egg`` have been deprecated and will be removed in the future. This "feature" has a long list of drawbacks where it diff --git a/pip/__init__.py b/pip/__init__.py index 1cd200532..e41ee8392 100755 --- a/pip/__init__.py +++ b/pip/__init__.py @@ -43,7 +43,7 @@ import pip.cmdoptions cmdoptions = pip.cmdoptions # The version as used in the setup.py and the docs conf.py -__version__ = "8.2.0.dev0" +__version__ = "9.0.0.dev0" logger = logging.getLogger(__name__) diff --git a/pip/index.py b/pip/index.py index b1d08f59d..5487f9c7d 100644 --- a/pip/index.py +++ b/pip/index.py @@ -20,7 +20,7 @@ from pip.utils import ( cached_property, splitext, normalize_path, ARCHIVE_EXTENSIONS, SUPPORTED_EXTENSIONS, ) -from pip.utils.deprecation import RemovedInPip9Warning, RemovedInPip10Warning +from pip.utils.deprecation import RemovedInPip10Warning from pip.utils.logging import indent_log from pip.utils.packaging import check_requires_python from pip.exceptions import ( @@ -198,7 +198,7 @@ class PackageFinder(object): warnings.warn( "Dependency Links processing has been deprecated and will be " "removed in a future release.", - RemovedInPip9Warning, + RemovedInPip10Warning, ) self.dependency_links.extend(links) diff --git a/pip/req/req_install.py b/pip/req/req_install.py index f9a66e0f2..cf7cba1fc 100644 --- a/pip/req/req_install.py +++ b/pip/req/req_install.py @@ -40,7 +40,7 @@ from pip.utils import ( ) from pip.utils.hashes import Hashes -from pip.utils.deprecation import RemovedInPip9Warning, RemovedInPip10Warning +from pip.utils.deprecation import RemovedInPip10Warning from pip.utils.logging import indent_log from pip.utils.setuptools_build import SETUPTOOLS_SHIM from pip.utils.ui import open_spinner @@ -1106,24 +1106,6 @@ def _strip_postfix(req): return req -def _build_req_from_url(url): - - parts = [p for p in url.split('#', 1)[0].split('/') if p] - - req = None - if len(parts) > 2 and parts[-2] in ('tags', 'branches', 'tag', 'branch'): - req = parts[-3] - elif len(parts) > 1 and parts[-1] == 'trunk': - req = parts[-2] - if req: - warnings.warn( - 'Sniffing the requirement name from the url is deprecated and ' - 'will be removed in the future. Please specify an #egg segment ' - 'instead.', RemovedInPip9Warning, - stacklevel=2) - return req - - def parse_editable(editable_req, default_vcs=None): """Parses an editable requirement into: - a requirement name @@ -1193,7 +1175,9 @@ def parse_editable(editable_req, default_vcs=None): package_name = Link(url).egg_fragment if not package_name: - package_name = _build_req_from_url(editable_req) + raise InstallationError( + "Could not detect requirement name, please specify one with #egg=" + ) if not package_name: raise InstallationError( '--editable=%s is not the right format; it must have ' diff --git a/pip/utils/deprecation.py b/pip/utils/deprecation.py index 74f621e01..c3f799e64 100644 --- a/pip/utils/deprecation.py +++ b/pip/utils/deprecation.py @@ -15,15 +15,15 @@ class Pending(object): pass -class RemovedInPip9Warning(PipDeprecationWarning): +class RemovedInPip10Warning(PipDeprecationWarning): pass -class RemovedInPip10Warning(PipDeprecationWarning, Pending): +class RemovedInPip11Warning(PipDeprecationWarning, Pending): pass -class Python26DeprecationWarning(PipDeprecationWarning, Pending): +class Python26DeprecationWarning(PipDeprecationWarning): pass