openedx / credentials

Service hosting course and program certificates
GNU Affero General Public License v3.0
22 stars 72 forks source link

Lxml 5.1.1 is breaking requirements installation #2468

Closed Danyal-Faheem closed 4 months ago

Danyal-Faheem commented 4 months ago

While installing the docker image using tutor-credentials nightly, the image build fails during the requirements installation step. The error is:

 WARNING: lxml 5.1.1 does not provide the extra 'html-clean'
 WARNING: lxml 5.1.1 does not provide the extra 'html_clean'
 ERROR: Exception:
 Traceback (most recent call last):
   File "/openedx/venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
     status = run_func(*args)
   File "/openedx/venv/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 248, in wrapper
     return func(self, options, args)
   File "/openedx/venv/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 377, in run
     requirement_set = resolver.resolve(
   File "/openedx/venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
     result = self._result = resolver.resolve(
   File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
     state = resolution.resolve(requirements, max_rounds=max_rounds)
   File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 427, in resolve
     failure_causes = self._attempt_to_pin_criterion(name)
   File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 249, in _attempt_to_pin_criterion
     satisfied = all(
   File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 250, in <genexpr>
     self._p.is_satisfied_by(requirement=r, candidate=candidate)
   File "/openedx/venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 240, in is_satisfied_by
     return requirement.is_satisfied_by(candidate)
   File "/openedx/venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/requirements.py", line 83, in is_satisfied_by
     assert candidate.name == self.name, (
 AssertionError: Internal issue: Candidate is not for this requirement lxml[html-clean,html-clean] vs lxml[html-clean]

This is likely because Lxml 5.1.1 is being installed which does not contain the html-clean extra.

Lxml 5.2.1 should be the package being installed here instead but the requirements do not list it as such because of the constraint

https://github.com/openedx/credentials/blob/50001319e183fe009735fb758c69b06605387080/requirements/constraints.txt#L22-L25

that was pinned in #2430. edx-i18n-tools has been updated as per this PR and it is safe to remove the constraint now.

Danyal-Faheem commented 4 months ago

Closing this issue since upgrading the setuptools, pip, wheel versions in the tutor-credentials Dockerfile fixes this issue.