pipenv: 2nd-order dependencies missing from Pipfile.lock

I believe the answer will be “astroid is packaged weird”, but this package is maintained by the PyCQA and works fine with the pip freeze > requirements.txt workflow, so I’m assuming other packages might exhibit this behavior.


$ pipenv --version
pipenv, version 7.0.1

$ pipenv install astroid --python=python2
Creating a virtualenv for this project…
...
Creating a Pipfile for this project…
Installing astroid…
Collecting astroid
  Using cached astroid-1.5.3-py2.py3-none-any.whl
Collecting wrapt (from astroid)
Collecting enum34>=1.1.3; python_version < "3.4" (from astroid)
  Using cached enum34-1.1.6-py2-none-any.whl
Collecting singledispatch; python_version < "3.4" (from astroid)
  Using cached singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting six (from astroid)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting lazy-object-proxy (from astroid)
Collecting backports.functools-lru-cache; python_version < "3.3" (from astroid)
  Using cached backports.functools_lru_cache-1.4-py2.py3-none-any.whl
Installing collected packages: wrapt, enum34, six, singledispatch, lazy-object-proxy, backports.functools-lru-cache, astroid
Successfully installed astroid-1.5.3 backports.functools-lru-cache-1.4 enum34-1.1.6 lazy-object-proxy-1.3.1 singledispatch-3.4.0.3 six-1.10.0 wrapt-1.10.11

Adding astroid to Pipfile's [packages]…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock!

$ .venv/bin/pip freeze
astroid==1.5.3
backports.functools-lru-cache==1.4
enum34==1.1.6
lazy-object-proxy==1.3.1
singledispatch==3.4.0.3
six==1.10.0
wrapt==1.10.11

$ cat Pipfile.lock
{
    "_meta": {
        ...
        file-spec": 3,
        "requires": {
            "python_version": "2.7"
        },
        "sources": [
            {
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "astroid": {
            "hashes": [
                "sha256:39a21dd2b5d81a6731dc0ac2884fa419532dffd465cdd43ea6c168d36b76efb3",
                "sha256:492c2a2044adbf6a84a671b7522e9295ad2f6a7c781b899014308db25312dd35"
            ],
            "version": "==1.5.3"
        },
        "lazy-object-proxy": {
            "hashes": [
                ...
            ],
            "version": "==1.3.1"
        },
        "six": {
            ...
        },
        "wrapt": {
            ...
        }
    },
    "develop": {}
}

backports.functools-lru-cache, enum34, and singledispatch are missing from the Pipfile.lock so future reinstalls (and CI runs) will fail.

$ pipenv graph
astroid==1.5.3
  - backports.functools-lru-cache [required: Any, installed: 1.4]
  - enum34 [required: >=1.1.3, installed: 1.1.6]
  - lazy-object-proxy [required: Any, installed: 1.3.1]
  - singledispatch [required: Any, installed: 3.4.0.3]
    - six [required: Any, installed: 1.10.0]
  - six [required: Any, installed: 1.10.0]
  - wrapt [required: Any, installed: 1.10.11]

I’m guessing that astroid’s installation conditionally includes the back-ported Python 2 dependencies, but pipenv graph seems to know about them so I don’t know why they’re missing.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 35 (35 by maintainers)

Commits related to this issue

Most upvoted comments

I’m going to see if I can fix this for you, but it won’t be easy.

Asteroid is packaged weird — very fancily, to be exact 😃