Skip to content

pipenv install via git subdirectory not working, though pip install does #4298

Closed
@chrisroat

Description

Using pipenv to install a dep via a git repo subdirectory is failing.

Steps to replicate

The following works fine in a virtualenv:

pip install "git+https://github.com/google/neuroglancer.git#subdirectory=python&egg=neuroglancer"

But the pipenv version does not work properly, though the Pipfile seems right to me.

$ pipenv install "git+https://github.com/google/neuroglancer.git#subdirectory=python&egg=neuroglancer"
Creating a Pipfile for this project…
Installing git+https://github.com/google/neuroglancer.git#subdirectory=python&egg=neuroglancer…
Adding neuroglancer to Pipfile's [packages]…
✔ Installation Succeeded 
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Building requirements...
Resolving dependencies...
✘ Locking Failed! 
Traceback (most recent call last):
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 807, in <module>
    main()
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 803, in main
    parsed.requirements_dir, parsed.packages, parse_only=parsed.parse_only)
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 785, in _main
    resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages)
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 753, in resolve_packages
    requirements_dir=requirements_dir,
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 736, in resolve
    req_dir=requirements_dir
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1386, in resolve_deps
    req_dir=req_dir,
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1091, in actually_resolve_deps
    deps, index_lookup, markers_lookup, project, sources, req_dir, clear, pre
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/utils.py", line 649, in create
    pre=pre, clear=clear
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/utils.py", line 463, in get_metadata
    req, resolver=transient_resolver
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/utils.py", line 540, in get_deps_from_req
    req_list, lockfile = get_vcs_deps(reqs=[req])
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1874, in get_vcs_deps
    with temp_path(), locked_repository(requirement) as repo:
  File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/utils.py", line 2031, in locked_repository
    with requirement.req.locked_vcs_repo(src_dir=src_dir) as repo:
  File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2212, in locked_vcs_repo
    self._parsed_line.vcsrepo = vcsrepo
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 916, in vcsrepo
    kwargs=wheel_kwargs,
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1918, in create
    created.get_initial_info()
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1747, in get_initial_info
    self.update_from_dict(self.parse_setup_py())
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1504, in parse_setup_py
    parsed = ast_parse_setup_py(self.setup_py.as_posix())
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1201, in ast_parse_setup_py
    ast_analyzer.unmap_binops()
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 729, in unmap_binops
    self.binOps_map[binop] = ast_unparse(binop, analyzer=self)
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1016, in ast_unparse
    right_item = unparse(item.right)
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1040, in ast_unparse
    items = unparse(analyzer.assignments[assignment])
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1140, in ast_unparse
    val = unparse(item.value, recurse=False)
  File "/home/croat/.local/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1004, in ast_unparse
    unparsed = unparsed[unparse(item.slice.value)]
TypeError: string indices must be integers

$ pipenv --support

Pipenv version: '2020.5.28'

Pipenv location: '/home/croat/.local/lib/python3.7/site-packages/pipenv'

Python location: '/usr/bin/python3.7'

Python installations found:

  • 3.7.5: /usr/bin/python3.7m
  • 3.7.5: /usr/bin/python3.7
  • 3.6.9: /usr/bin/python3.6m
  • 3.6.9: /usr/bin/python3
  • 3.6.9: /usr/bin/python3.6
  • 2.7.17: /usr/bin/python2
  • 2.7.17: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.5',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.3.0-53-generic',
 'platform_system': 'Linux',
 'platform_version': '#47~18.04.1-Ubuntu SMP Thu May 7 13:10:50 UTC 2020',
 'python_full_version': '3.7.5',
 'python_version': '3.7',
 'sys_platform': 'linux'}

System environment variables:

  • CLUTTER_IM_MODULE
  • CONDA_SHLVL
  • NVM_DIR
  • CONDA_EXE
  • XDG_MENU_PREFIX
  • LANG
  • HISTIGNORE
  • HISTCONTROL
  • DISPLAY
  • HISTTIMEFORMAT
  • OLDPWD
  • GNOME_SHELL_SESSION_MODE
  • EDITOR
  • COLORTERM
  • NVM_CD_FLAGS
  • BASH_SILENCE_DEPRECATION_WARNING
  • USERNAME
  • XDG_VTNR
  • SSH_AUTH_SOCK
  • S_COLORS
  • _CE_M
  • XDG_SESSION_ID
  • USER
  • DESKTOP_SESSION
  • QT4_IM_MODULE
  • TEXTDOMAINDIR
  • GNOME_TERMINAL_SCREEN
  • PWD
  • HOME
  • CONDA_PYTHON_EXE
  • TEXTDOMAIN
  • SSH_AGENT_PID
  • QT_ACCESSIBILITY
  • XDG_SESSION_TYPE
  • XDG_DATA_DIRS
  • _CE_CONDA
  • XDG_SESSION_DESKTOP
  • GJS_DEBUG_OUTPUT
  • GTK_MODULES
  • VISUAL
  • WINDOWPATH
  • TERM
  • SHELL
  • VTE_VERSION
  • QT_IM_MODULE
  • XMODIFIERS
  • IM_CONFIG_PHASE
  • NVM_BIN
  • XDG_CURRENT_DESKTOP
  • GPG_AGENT_INFO
  • GNOME_TERMINAL_SERVICE
  • XDG_SEAT
  • SHLVL
  • GDMSESSION
  • GNOME_DESKTOP_SESSION_ID
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • XDG_CONFIG_DIRS
  • PATH
  • PS1
  • HISTSIZE
  • GJS_DEBUG_TOPICS
  • HISTFILESIZE
  • SESSION_MANAGER
  • GTK_IM_MODULE
  • _
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/croat/miniconda3/condabin:/home/croat/.nvm/versions/node/v14.3.0/bin:/home/croat/google-cloud-sdk/bin:/home/croat/bin:/home/croat/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • EDITOR: emacs
  • LANG: en_US.UTF-8
  • PWD: /home/croat/test

Contents of Pipfile ('/home/croat/test/Pipfile'):

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
neuroglancer = {git = "https://github.com/google/neuroglancer.git", subdirectory = "python"}

[requires]
python_version = "3.7"

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions