Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-31057

Pypi simple index should be proper HTML5 document to be PEP503 compliant and ready for pip version 22.2 and newer

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.37.3
    • Fix Version/s: 3.38.0
    • Component/s: PyPI
    • Labels:
    • Story Points:
      2
    • Sprint:
      NXRM MadMax Sprint 27
    • Notability:
      3
    • InvestmentLayer:
      support-escalated
    • Aha Concept:
      non-concept

      Description

      Nexus is not compatible with the latest pip 22.0.  Pip is now validating the response from Nexus to see if it is valid HTML5 and fails because Nexus is not including the HTML doctype.

      Temporary workaround is to run pip with the “--use-deprecated=html5lib” flag.

      https://github.com/pypa/pip/issues/10825

      $ pip install --upgrade pip
      Looking in indexes: https://nexus.example.com/repository/pypi-group/simple
      Requirement already satisfied: pip in /home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages (22.0)
      ERROR: Exception:
      Traceback (most recent call last):
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 165, in exc_logging_wrapper
          status = run_func(*args)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
          return func(self, options, args)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 339, in run
          requirement_set = resolver.resolve(
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 94, in resolve
          result = self._result = resolver.resolve(
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve
          state = resolution.resolve(requirements, max_rounds=max_rounds)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 348, in resolve
          self._add_to_criteria(self.state.criteria, r, parent=None)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 172, in _add_to_criteria
          if not criterion.candidates:
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/structs.py", line 151, in __bool__
          return bool(self._sequence)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
          return any(self)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
          return (c for c in iterator if id(c) not in self._incompatible_ids)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 90, in _iter_built_with_inserted
          for version, func in infos:
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 294, in iter_index_candidate_infos
          result = self._finder.find_best_candidate(
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/index/package_finder.py", line 868, in find_best_candidate
          candidates = self.find_all_candidates(project_name)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/index/package_finder.py", line 809, in find_all_candidates
          page_candidates = list(page_candidates_it)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/index/sources.py", line 134, in page_candidates
          yield from self._candidates_from_page(self._link)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/index/package_finder.py", line 773, in process_project_url
          page_links = list(parse_links(html_page, self._use_deprecated_html5lib))
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/index/collector.py", line 310, in wrapper_wrapper
          return list(fn(page, use_deprecated_html5lib))
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/index/collector.py", line 350, in parse_links
          parser.feed(page.content.decode(encoding))
        File "/home/user/.pyenv/versions/3.9.9/lib/python3.9/html/parser.py", line 110, in feed
          self.goahead(0)
        File "/home/user/.pyenv/versions/3.9.9/lib/python3.9/html/parser.py", line 170, in goahead
          k = self.parse_starttag(i)
        File "/home/user/.pyenv/versions/3.9.9/lib/python3.9/html/parser.py", line 344, in parse_starttag
          self.handle_starttag(tag, attrs)
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/index/collector.py", line 410, in handle_starttag
          self._raise_error()
        File "/home/user/.pyenv/versions/3.9.9/envs/venv/lib/python3.9/site-packages/pip/_internal/index/collector.py", line 426, in _raise_error
          raise ValueError(
      ValueError: HTML doctype missing or incorrect. Expected <!DOCTYPE html>.
      
      If you believe this error to be incorrect, try passing the command line option --use-deprecated=html5lib and please leave a comment on the pip issue at https://github.com/pypa/pip/issues/10825.
      
      

        Attachments

          Activity

            People

            Assignee:
            ybulatnikov Eugene Bulatnikov
            Reporter:
            tcassidy Tom Cassidy
            CC:
            ITN DEVAUT
            Last Updated By:
            Rich Seddon Rich Seddon
            Team:
            NXRM - Mad Max
            Votes:
            22 Vote for this issue
            Watchers:
            34 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title