Skip to content

pipenv does not pull in extras if extra name does not match module name #5944

@thehesiod

Description

@thehesiod

Issue description

If a requirement has extras, with a name that does not match the module name the module will not get added to the lockfile

$ cat Pipfile
[packages]
hypothesis = {extras = ["datetime"]}

[requires]
python_version = "3.11"

Note that the datetime extra should pull in pytz: https://github.com/bennylope/hypothesis-python/blob/master/setup.py#L41

Expected result

Extras specified should get added

Actual result

$ cat Pipfile.lock 
{
    "_meta": {
        "hash": {
            "sha256": "f1eb1944c7bc948a5bc4e1d5dd0a8e75b99e6b43cad9d3a3c222e3f840a9a3bc"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.11"
        },
        "sources": [
            {
                "name": "pip_conf_index_global",
                "url": "https://pypi.fbn.org/simple",
                "verify_ssl": false
            }
        ]
    },
    "default": {
        "attrs": {
            "hashes": [
                "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04",
                "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==23.1.0"
        },
        "hypothesis": {
            "extras": [
                "datetime"
            ],
            "hashes": [
                "sha256:e1d36522824d62bb3e9fcb7b57dd4a6ca330bb36921324bb19c476bdafabeda7",
                "sha256:e5d75d70f5a4fc372cddf03ec6141237a0a270ed106aeb2156a4984f06d37b0f"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==6.86.2"
        },
        "sortedcontainers": {
            "hashes": [
                "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88",
                "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0"
            ],
            "version": "==2.4.0"
        }
    },
    "develop": {}
}

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).


$ pipenv --support

Pipenv version: '2023.9.8'

Pipenv location: '/opt/homebrew/lib/python3.11/site-packages/pipenv'

Python location: '/opt/homebrew/opt/[email protected]/bin/python3.11'

OS Name: 'posix'

User pip version: '23.2.1'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.11.4',
 'os_name': 'posix',
 'platform_machine': 'arm64',
 'platform_python_implementation': 'CPython',
 'platform_release': '22.6.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT '
                     '2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6000',
 'python_full_version': '3.11.4',
 'python_version': '3.11',
 'sys_platform': 'darwin'}

System environment variables:

  • SHELL
  • NVM_RC_VERSION
  • XPC_FLAGS
  • HISTCONTROL
  • TERM_PROGRAM_VERSION
  • PKG_CONFIG_PATH
  • HISTSIZE
  • __CFBundleIdentifier
  • SSH_AUTH_SOCK
  • TERM_SESSION_ID
  • GPG_TTY
  • PWD
  • LOGNAME
  • LaunchInstanceID
  • HOME
  • LANG
  • SECURITYSESSIONID
  • TMPDIR
  • FBNSECRETS_FORCE_USER
  • NVM_DIR
  • GEM_HOME
  • TERM
  • USER
  • SHLVL
  • NVM_CD_FLAGS
  • XPC_SERVICE_NAME
  • PS1
  • PATH
  • HOMEBREW_CASK_OPTS
  • OLDPWD
  • TERM_PROGRAM
  • _
  • __CF_USER_TEXT_ENCODING
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /Users/alexmohr/Downloads/google-cloud-sdk/bin:/opt/homebrew/opt/openjdk/bin:/Users/alexmohr/.gem/bin:/opt/homebrew/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/opt/[email protected]/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/opt/openjdk/bin:~/.gem/ruby/2.6.0/bin:/Users/alexmohr/dev/fbn.com/ops/docker/ecr/bin:~/Applications/Sublime Text.app/Contents/SharedSupport/bin
  • SHELL: /opt/homebrew/bin/bash
  • LANG: en_US.UTF-8
  • PWD: /tmp/test

Contents of Pipfile ('/private/tmp/test/Pipfile'):

[packages]
hypothesis = {extras = ["datetime"]}

[requires]
python_version = "3.11"

Contents of Pipfile.lock ('/private/tmp/test/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "f1eb1944c7bc948a5bc4e1d5dd0a8e75b99e6b43cad9d3a3c222e3f840a9a3bc"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.11"
        },
        "sources": [
            {
                "name": "pip_conf_index_global",
                "url": "https://pypi.fbn.org/simple",
                "verify_ssl": false
            }
        ]
    },
    "default": {
        "attrs": {
            "hashes": [
                "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04",
                "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==23.1.0"
        },
        "hypothesis": {
            "extras": [
                "datetime"
            ],
            "hashes": [
                "sha256:e1d36522824d62bb3e9fcb7b57dd4a6ca330bb36921324bb19c476bdafabeda7",
                "sha256:e5d75d70f5a4fc372cddf03ec6141237a0a270ed106aeb2156a4984f06d37b0f"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==6.86.2"
        },
        "sortedcontainers": {
            "hashes": [
                "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88",
                "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0"
            ],
            "version": "==2.4.0"
        }
    },
    "develop": {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions