pipenv only updates dev dependencies in Pipfile.loc file ignoring default packages

1k Views Asked by At

I have started using pipenv to manage my python dependencies and it looks like Pipfile.lock is failing to update default packages.

Pipfile

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

[packages]
cerberus = "~=1.3"

[dev-packages]
pytest = "*"

[requires]
python_version = "3.7"

[packages.dynaconf]
extras = [ "yaml",]
version = "*"

Pipfile.lock containing only dev dependencies.

{
    "_meta": {
        "hash": {
            "sha256": "7a3d83ecff95a0891540c3bb7300a1eca8b091e1f37ea68251977ad623f31bec"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "dynaconf": {
            "extras": [
                "yaml"
            ],
            "version": "*"
        }
    },
    "develop": {
        "attrs": {
            "hashes": [
                "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4",
                "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"
            ],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
            "version": "==21.4.0"
        },
        "importlib-metadata": {
            "hashes": [
                "sha256:1208431ca90a8cca1a6b8af391bb53c1a2db74e5d1cef6ddced95d4b2062edc6",
                "sha256:ea4c597ebf37142f827b8f39299579e31685c31d3a438b59f469406afd0f2539"
            ],
            "markers": "python_version < '3.8'",
            "version": "==4.11.3"
        },
        "iniconfig": {
            "hashes": [
                "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3",
                "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"
            ],
            "version": "==1.1.1"
        },
        "packaging": {
            "hashes": [
                "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb",
                "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"
            ],
            "markers": "python_version >= '3.6'",
            "version": "==21.3"
        },
        "pluggy": {
            "hashes": [
                "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159",
                "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"
            ],
            "markers": "python_version >= '3.6'",
            "version": "==1.0.0"
        },
        "py": {
            "hashes": [
                "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719",
                "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"
            ],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
            "version": "==1.11.0"
        },
        "pyparsing": {
            "hashes": [
                "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea",
                "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484"
            ],
            "markers": "python_version >= '3.6'",
            "version": "==3.0.7"
        },
        "pytest": {
            "hashes": [
                "sha256:841132caef6b1ad17a9afde46dc4f6cfa59a05f9555aae5151f73bdf2820ca63",
                "sha256:92f723789a8fdd7180b6b06483874feca4c48a5c76968e03bb3e7f806a1869ea"
            ],
            "index": "pypi",
            "version": "==7.1.1"
        },
        "tomli": {
            "hashes": [
                "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
                "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==2.0.1"
        },
        "typing-extensions": {
            "hashes": [
                "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42",
                "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2"
            ],
            "markers": "python_version < '3.8'",
            "version": "==4.1.1"
        },
        "zipp": {
            "hashes": [
                "sha256:9f50f446828eb9d45b267433fd3e9da8d801f614129124863f9c51ebceafb87d",
                "sha256:b47250dd24f92b7dd6a0a8fc5244da14608f3ca90a5efcd37a3b1642fac9a375"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==3.7.0"
        }
    }
}

Following are the commands I tried to run to update relevant dependencies in lock file

$ pipenv shell
$ pipenv install --skip-lock
$ pipenv lock

Any inputs what is going wrong here?

Thanks for your time.

2

There are 2 best solutions below

0
On

Maybe I misunderstand, but I don't know if Pipenv is supposed to update packages by default? If it did so automatically, it could possibly mess up the environment you're building with it, no?

Anyway, you do have the option of manually updating the dependencies in your Pipfile and the .lock with pipenv update

0
On

Issue was with the addtional section I have added in Pipefile

[packages.dynaconf]
extras = [ "yaml",]
version = "*"

Merging it under [packages] section resolved the issue as

[packages]
dynaconf = {extras = ["yaml"],version = "*"}