question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Locking does not respect editable flag for local packages in multiple categories

See original GitHub issue

Issue description

If a local package is specified in both default and develop categories with different values for editable, after locking the value from the default category is used in both places in the lockfile. If the local package is not provided in default category, then the locking works correctly in that the value of editable is correct in the lockfile’s develop category. I haven’t found any specification that says that the same package can’t be provided in multiple categories, so I’d expect this to work properly.

As context, the use case for having the local package specified twice is that at deployment time you want to just build a wheel and install that without any symlinks etc., whereas at development time, you want to have the editable distribution.

Expected result

in the lockfile, editable is false for default category and true for develop category

    "default": {
        "packaging": {
            "path": "./packaging",
            "version": "==21.4.dev0"
        }
    },
    "develop": {
        "packaging": {
            "path": "./packaging",
            "version": "==21.4.dev0",
            "editable": true
        }
    }

Actual result

in the lockfile, editable is false for default category and false for develop category

    "default": {
        "packaging": {
            "path": "./packaging",
            "version": "==21.4.dev0"
        }
    },
    "develop": {
        "packaging": {
            "path": "./packaging",
            "version": "==21.4.dev0"
        }
    }

Steps to replicate

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

mkdir pipenv_sandbox
cd pipenv_sandbox
git clone https://github.com/pypa/packaging
# populate Pipfile as below in details section
pipenv lock --dev
# observe that editable is set to False in develop category

$ pipenv --support

Pipenv version: '2022.10.12'

Pipenv location: '/Users/micahsmith/.pyenv/versions/3.9.13/lib/python3.9/site-packages/pipenv'

Python location: '/Users/micahsmith/.pyenv/versions/3.9.13/bin/python3.9'

OS Name: 'posix'

User pip version: '22.2.2'

user Python installations found:

  • 3.10.7: /usr/local/bin/python3
  • 3.10.6: /Users/micahsmith/.pyenv/versions/3.10.6/bin/python3
  • 3.9.15: /usr/local/bin/python3.9
  • 3.9.13: /Users/micahsmith/.pyenv/versions/3.9.13/bin/python3
  • 3.9.13: /Users/micahsmith/.pyenv/versions/3.9.13/bin/python3
  • 3.9.13: /Users/micahsmith/.pyenv/versions/3.9.13/bin/python
  • 3.9.13: /Users/micahsmith/.pyenv/versions/3.9.13/bin/python3.9
  • 3.9.6: /usr/bin/python3
  • 3.8.15: /usr/local/bin/python3.8
  • 3.8.3: /Users/micahsmith/.pyenv/versions/3.8.3/bin/python3
  • 3.7.7: /Users/micahsmith/.pyenv/versions/3.7.7/bin/python3
  • 3.6.13: /Users/micahsmith/.pyenv/versions/3.6.13/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.9.13',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '21.6.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT '
                     '2022; root:xnu-8020.140.49~2/RELEASE_X86_64',
 'python_full_version': '3.9.13',
 'python_version': '3.9',
 'sys_platform': 'darwin'}

System environment variables (redacted):

  • PYENV_ROOT
  • PIPENV_VENV_IN_PROJECT
  • PYENV_VERSION
  • PIPENV_IGNORE_VIRTUALENVS
  • PYENV_DIR
  • PYENV_VIRTUALENV_INIT
  • PYENV_HOOK_PATH
  • PYENV_SHELL
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIP_PYTHON_PATH
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: 1
  • PIPENV_IGNORE_VIRTUALENVS: ``

Debug–specific environment variables:

  • PATH: /Users/micahsmith/.pyenv/versions/3.9.13/bin:/usr/local/Cellar/pyenv/2.3.5/libexec:/usr/local/Cellar/pyenv/2.3.5/plugins/python-build/bin:/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/micahsmith/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/Users/micahsmith/.gem/ruby/2.7.0/bin:/usr/local/opt/ruby/bin:/usr/local/opt/libxml2/bin:/Users/micahsmith/go/bin:/usr/local/sbin:/usr/local/opt/util-linux/bin:/usr/local/opt/findutils/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/micahsmith/.local/bin:/Users/micahsmith/local/bin:/usr/local/opt/fzf/bin
  • SHELL: /bin/bash
  • EDITOR: vim
  • LANG: en_US.UTF-8
  • PWD: /Users/micahsmith/workspace/pipenv_sandbox

Contents of Pipfile (‘/Users/micahsmith/workspace/pipenv_sandbox/Pipfile’):

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

[packages]
packaging = {path = "./packaging", editable = false}

[dev-packages]
packaging = {path = "./packaging", editable = true}

[requires]
python_version = "3.10"
python_full_version = "3.10.7"

Contents of Pipfile.lock (‘/Users/micahsmith/workspace/pipenv_sandbox/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "acd2f70bd2a5c1fbe0c7506327757fc7e6638811524980dc6c5f02376f91b47d"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_full_version": "3.10.7",
            "python_version": "3.10"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "packaging": {
            "editable": false,
            "path": "./packaging",
            "version": "==21.4.dev0"
        }
    },
    "develop": {
        "packaging": {
            "editable": false,
            "path": "./packaging",
            "version": "==21.4.dev0"
        }
    }
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
oz123commented, Oct 25, 2022

Thank you for the thorough bug report. We’ll try to fix this as soon as possible. We have full time jobs, so it might take a while!

0reactions
micahjsmithcommented, Nov 4, 2022

Makes sense, thanks for the discussion, going to close this then as expected behavior

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipenv installs incorrect version of package #2088 - GitHub
My pipfile and pipfile.lock both specify an explicit version of Django - 1.8.11. Locally, using python3 on a Mac, this install works fine....
Read more >
pipenv Documentation - Read the Docs
Pipenv uses two files to do this: Pipfile and Pipfile.lock (which will look ... 3.5.4 Pipenv does not respect pyenv's global and local...
Read more >
File Locking - GitLab Docs
This process allows you to lock single files or file extensions and it is done through the command line. It doesn't require GitLab...
Read more >
Packages in editable mode — conan 1.35.2 documentation
With the editable packages, you can tell Conan where to find the headers and the artifacts ready for consumption in your local working...
Read more >
pipenv Changelog - PyUp.io
- Adjust pipenv to work with the newly added ``venv`` install scheme in Python. First check if ``venv`` is among the available install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found