Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipenv check fails inside python3-alpine #2176

Closed
sobolevn opened this issue May 11, 2018 · 3 comments
Closed

pipenv check fails inside python3-alpine #2176

sobolevn opened this issue May 11, 2018 · 3 comments
Labels
Category: Docker Issue affects docker builds. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@sobolevn
Copy link
Contributor

$ python -m pipenv.help output

Pipenv version: '11.10.1'

Pipenv location: '/usr/local/lib/python3.6/site-packages/pipenv'

Python location: '/usr/local/opt/python/bin/python3.6'

Other Python installations in PATH:

  • 2.6: /usr/bin/python2.6

  • 2.6: /usr/bin/python2.6

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.6: /usr/local/bin/python3.6m

  • 3.6: /usr/local/bin/python3.6

  • 3.6: /usr/local/bin/python3.6

  • 2.7.14: /usr/local/bin/python

  • 2.7.14: /usr/local/bin/python

  • 2.7.10: /usr/bin/python

  • 2.7.14: /usr/local/bin/python2

  • 2.7.14: /usr/local/bin/python2

  • 3.6.5: /usr/local/bin/python3

  • 3.6.5: /usr/local/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.5',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '15.6.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 15.6.0: Fri Feb 17 10:21:18 PST '
                     '2017; root:xnu-3248.60.11.4.1~1/RELEASE_X86_64',
 'python_full_version': '3.6.5',
 'python_version': '3.6',
 'sys_platform': 'darwin'}

System environment variables:

  • TMPDIR
  • TERM_PROGRAM_VERSION
  • Apple_PubSub_Socket_Render
  • LANG
  • TERM_PROGRAM
  • XPC_SERVICE_NAME
  • XPC_FLAGS
  • TERM_SESSION_ID
  • SSH_AUTH_SOCK
  • TERM
  • __CF_USER_TEXT_ENCODING
  • SHELL
  • HOME
  • LOGNAME
  • USER
  • PATH
  • SHLVL
  • PWD
  • OLDPWD
  • ZSH
  • PAGER
  • LESS
  • LC_CTYPE
  • LSCOLORS
  • VIRTUAL_ENV_DISABLE_PROMPT
  • LS_COLORS
  • CLICOLOR
  • GREP_COLOR
  • EDITOR
  • GPG_TTY
  • GPG_AGENT_INFO
  • PYTHONIOENCODING
  • HOMEBREW_NO_ANALYTICS
  • MANPAGER
  • PIPENV_VENV_IN_PROJECT
  • PIPENV_HIDE_EMOJIS
  • PIPENV_COLORBLIND
  • PIPENV_NOSPIN
  • NVM_DIR
  • NVM_CD_FLAGS
  • PYENV_SHELL
  • NODE_REPL_HISTORY
  • NODE_REPL_MODE
  • ERL_AFLAGS
  • FZF_DEFAULT_COMMAND
  • FZF_CTRL_T_COMMAND
  • SOBOLE_DEFAULT_USER
  • LC_ALL
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: true
  • PIPENV_HIDE_EMOJIS: true
  • PIPENV_COLORBLIND: true
  • PIPENV_NOSPIN: true

Debug–specific environment variables:

  • PATH: /Users/sobolev/.pyenv/shims:/Users/sobolev/.local/bin:/usr/local/opt/python2/libexec/bin:/usr/local/opt/gpg-agent/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/local/opt/php56/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/fzf/bin
  • SHELL: /usr/local/bin/zsh
  • EDITOR: /usr/local/bin/nano
  • LANG: ru_RU.UTF-8
  • PWD: /Users/sobolev


Expected result

I expect that pipenv check will work inside docker the same as locally.

Actual result

Locally:

» pipenv check
Checking PEP 508 requirements…
Passed!
Checking installed package safety…
All good!

Inside docker:

System check identified no issues (0 silenced).
No changes detected
Checking PEP 508 requirements…
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 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, 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 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 678, in check
    three=three, python=python, system=system, unused=unused, args=args
  File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 2337, in do_check
    results = simplejson.loads(c.out)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/delegator.py", line 97, in out
    self.__out = self.std_out.read()
ValueError: I/O operation on closed file.
Steps to replicate

Dockerfile:

FROM python:3.6.5-alpine3.7

LABEL maintainer="sobolevn@wemake.services"
LABEL vendor="wemake.services"

ARG DJANGO_ENV=production
ENV PYTHONFAULTHANDLER=1 \
  PYTHONUNBUFFERED=1 \
  PYTHONHASHSEED=random \
  PIP_NO_CACHE_DIR=off \
  PIP_DISABLE_PIP_VERSION_CHECK=on \
  PIP_DEFAULT_TIMEOUT=100 \
  PIPENV_COLORBLIND=true \
  PIPENV_NOSPIN=true


# System deps:

RUN apk update \
    && apk --no-cache add \
      bash \
      build-base \
      curl \
      gcc \
      gettext \
      git \
      libffi-dev \
      linux-headers \
      musl-dev \
      postgresql-dev \
      tini


# Creating folders, and files for a project:

WORKDIR /code
COPY . /code

# This is a special case. We need to run this script as entry point:
COPY ./docker/django/entrypoint.sh /docker-entrypoint.sh


# Project initialization:

RUN chmod +x "/docker-entrypoint.sh" \
  && pip install pipenv \
  && pipenv install $(test "$DJANGO_ENV" == production || echo "--dev") --deploy --system --ignore-pipfile

ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint.sh"]

And run pipenv check.

Or download this template: https://github.com/wemake-services/wemake-django-template
And run: docker-compose run --rm web sh ./docker/ci.sh

@uranusjr
Copy link
Member

Looks like a bug in delegator.py. Probably want to report there.

@uranusjr uranusjr added Category: Docker Issue affects docker builds. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. labels May 11, 2018
@sobolevn
Copy link
Contributor Author

@uranusjr thanks. Reporting there.

@techalchemy
Copy link
Member

If you guys can troubleshoot this at all and open a PR over there we can get it merged and expedited over here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Docker Issue affects docker builds. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

No branches or pull requests

3 participants