Locking does not respect editable flag for local packages in multiple categories
See original GitHub issueIssue 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:
- Created a year ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
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!
Makes sense, thanks for the discussion, going to close this then as expected behavior