Skip to content

Commit

Permalink
Dockefile: enforce pipenv version <= 2022.4.8
Browse files Browse the repository at this point in the history
The newer versions of pipenv > 2022.4.20 dropped support
of Python v3.6 [1] which we still rely on. This causes the
following error when installing dependencies using the newer
version of pipenv:

  Installing dependencies from Pipfile.lock (8c6e1b)...
  Traceback (most recent call last):
    File "/usr/local/bin/pipenv", line 11, in <module>
      sys.exit(cli())
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__
      return self.main(*args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/pipenv/cli/options.py", line 56, in main
      return super().main(*args, **kwargs, windows_expand_args=False)
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1053, in main
      rv = self.invoke(ctx)
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1659, in invoke
      return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke
      return ctx.invoke(self.callback, **ctx.params)
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
      return __callback(*args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
      return ctx.invoke(f, obj, *args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
      return __callback(*args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/pipenv/cli/command.py", line 241, in install
      site_packages=state.site_packages,
    File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 2102, in do_install
      keep_outdated=keep_outdated,
    File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 1343, in do_init
      pypi_mirror=pypi_mirror,
    File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 870, in do_install_dependencies
      project, normal_deps, procs, failed_deps_queue, requirements_dir, **install_kwargs
    File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 728, in batch_install
      dep for dep in deps_to_install if not project.environment.is_satisfied(dep)
    File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 728, in <listcomp>
      dep for dep in deps_to_install if not project.environment.is_satisfied(dep)
    File "/usr/local/lib/python3.6/site-packages/pipenv/environment.py", line 859, in is_satisfied
      elif req.line_instance.specifiers is not None:
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2553, in line_instance
      self.line_instance = self.get_line_instance()
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2547, in get_line_instance
      return Line(line)
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 171, in __init__
      self.parse()
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1289, in parse
      self.parse_extras()
    File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 577, in parse_extras
      self.line, extras = pip_shims.shims._strip_extras(self.line)
  TypeError: 'NoneType' object is not callable

We thus enforce downgrading the pipenv to the latest working
version <= 2022.4.8. This is more a temporary fix then a satisfying
solution. The core of the problem is the EOL of Python 3.6
(security support ended on 23 Dec 2021). It is still maintained
in current versions by CentOS 7 and Oracle Linux 8 distributions,
however it still prevents us to install other Python dependencies
unavailable in RPM reporitories using pip, so we should upgrade
ASAP.

[1] pypa/pipenv#4829

Commit originally created by Jan Kucera <[email protected]> in
dcpro project.
  • Loading branch information
KrobotP committed Apr 26, 2022
1 parent 94a8e55 commit 403b3af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6

COPY Pipfile Pipfile.lock /tmp/
RUN python3 -m pip install pipenv && cd /tmp && pipenv install --dev --system --deploy
RUN python3 -m pip install 'pipenv<=2022.4.8' && cd /tmp && pipenv install --dev --system --deploy
2 changes: 1 addition & 1 deletion Dockerfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ RUN <<EOF
yum install -y oracle-epel-release-el8
yum install -y python3 gcc strace make
yum clean all
python3 -m pip install pipenv && cd /tmp && pipenv install --dev --system --deploy
python3 -m pip install 'pipenv<=2022.4.8' && cd /tmp && pipenv install --dev --system --deploy
EOF

0 comments on commit 403b3af

Please sign in to comment.