Pipenv 2022.8.13 breaks libraries that require packaging #5247
Description
Issue description
It appears that libraries that explicitly require packaging cannot work on the latest version of pipenv.
Consider a simple project:
main.py
from dataclasses_json import DataClassJsonMixin
def print_hi(name):
print(f'Hi, {name}') # Press ⌘F8 to toggle the breakpoint.
if __name__ == '__main__':
print_hi('PyCharm')
pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
dataclasses-json = "*"
[dev-packages]
[requires]
python_version = "3.8"
dockerfile
FROM python:3.8-slim AS build
RUN python -m venv /opt/venv
ENV PATH=/opt/venv/bin:$PATH
ENV VIRTUAL_ENV=/opt/venv
ENV PIPENV_VERBOSITY=-1
COPY . .
RUN python -m pip install -U pip
RUN python -m pip install -U pipenv
RUN pipenv install --deploy
RUN python main.py
Expected result
This should run successfully - on pipenv 2022.8.5 it does, but on 2022.8.13 it does not
Actual result
=> ERROR [7/7] RUN python main.py 1.3s
------
> [7/7] RUN python main.py:
#11 0.976 Traceback (most recent call last):
#11 0.976 File "main.py", line 1, in <module>
#11 0.976 from dataclasses_json import DataClassJsonMixin
#11 0.976 File "/opt/venv/lib/python3.8/site-packages/dataclasses_json/__init__.py", line 2, in <module>
#11 0.976 from dataclasses_json.api import (DataClassJsonMixin,
#11 0.976 File "/opt/venv/lib/python3.8/site-packages/dataclasses_json/api.py", line 6, in <module>
#11 0.976 from dataclasses_json.cfg import config, LetterCase # noqa: F401
#11 0.976 File "/opt/venv/lib/python3.8/site-packages/dataclasses_json/cfg.py", line 5, in <module>
#11 0.976 from marshmallow.fields import Field as MarshmallowField
#11 0.976 File "/opt/venv/lib/python3.8/site-packages/marshmallow/__init__.py", line 3, in <module>
#11 0.976 from packaging.version import Version
#11 0.976 ModuleNotFoundError: No module named 'packaging'
------
executor failed running [/bin/sh -c python main.py]: exit code: 1
Steps to replicate
Provide the steps to replicate (which usually at least includes the commands and the Pipfile).
$ pipenv --support
Pipenv version: '2022.8.13'
Pipenv location: '/usr/local/lib/python3.9/site-packages/pipenv'
setuptools version: '62.3.2'
Python location: '/usr/local/opt/python@3.9/bin/python3.9'
OS Name: 'posix'
User pip version: '22.2.2'
user Python installations found:
3.10.6
:/Users/zacksmith/.pyenv/versions/3.10.6/bin/python3
3.9.13
:/usr/local/bin/python3
3.9.13
:/usr/local/bin/python
3.9.13
:/usr/local/bin/python3.9
3.8.9
:/Users/zacksmith/.local/share/virtualenvs/pythonProject-SGNO3Kqj/bin/python3
3.8.9
:/Users/zacksmith/.local/share/virtualenvs/pythonProject-SGNO3Kqj/bin/python
3.8.9
:/Users/zacksmith/.local/share/virtualenvs/pythonProject-SGNO3Kqj/bin/python3.8
3.8.9
:/Users/zacksmith/.local/share/virtualenvs/pythonProject-SGNO3Kqj/bin/python3
3.8.9
:/Users/zacksmith/.local/share/virtualenvs/pythonProject-SGNO3Kqj/bin/python
3.8.9
:/Users/zacksmith/.local/share/virtualenvs/pythonProject-SGNO3Kqj/bin/python3.8
3.8.9
:/usr/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.5.0',
'platform_system': 'Darwin',
'platform_version': 'Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT '
'2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000',
'python_full_version': '3.9.13',
'python_version': '3.9',
'sys_platform': 'darwin'}
System environment variables:
PATH
__CFBundleIdentifier
SHELL
SECURITYSESSIONID
TERM
USER
TMPDIR
LaunchInstanceID
COMMAND_MODE
TERMINAL_EMULATOR
LOGIN_SHELL
__INTELLIJ_COMMAND_HISTFILE__
SSH_AUTH_SOCK
XPC_FLAGS
TERM_SESSION_ID
__CF_USER_TEXT_ENCODING
LOGNAME
LC_CTYPE
XPC_SERVICE_NAME
HOME
SHLVL
PWD
OLDPWD
ZSH
PAGER
LESS
LSCOLORS
EDITOR
VIRTUAL_ENV
PS1
_
PIP_SHIMS_BASE_MODULE
PIP_DISABLE_PIP_VERSION_CHECK
PIP_PYTHON_PATH
PYTHONDONTWRITEBYTECODE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/Users/zacksmith/.local/share/virtualenvs/pythonProject-SGNO3Kqj/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
SHELL
:/bin/zsh
EDITOR
:nano
PWD
:/Users/zacksmith/PycharmProjects/pythonProject
VIRTUAL_ENV
:/Users/zacksmith/.local/share/virtualenvs/pythonProject-SGNO3Kqj
Contents of Pipfile
('/Users/zacksmith/PycharmProjects/pythonProject/Pipfile'):
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
dataclasses-json = "*"
[dev-packages]
[requires]
python_version = "3.8"
Contents of Pipfile.lock
('/Users/zacksmith/PycharmProjects/pythonProject/Pipfile.lock'):
{
"_meta": {
"hash": {
"sha256": "a9f040ac3c1c6914bff31a3219d8962b00c4f27bc90356e64666b6a30379bdf6"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.8"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"dataclasses-json": {
"hashes": [
"sha256:bc285b5f892094c3a53d558858a88553dd6a61a11ab1a8128a0e554385dcc5dd",
"sha256:c2c11bc8214fbf709ffc369d11446ff6945254a7f09128154a7620613d8fda90"
],
"index": "pypi",
"version": "==0.5.7"
},
"marshmallow": {
"hashes": [
"sha256:00040ab5ea0c608e8787137627a8efae97fabd60552a05dc889c888f814e75eb",
"sha256:635fb65a3285a31a30f276f30e958070f5214c7196202caa5c7ecf28f5274bc7"
],
"markers": "python_version >= '3.7'",
"version": "==3.17.0"
},
"marshmallow-enum": {
"hashes": [
"sha256:38e697e11f45a8e64b4a1e664000897c659b60aa57bfa18d44e226a9920b6e58",
"sha256:57161ab3dbfde4f57adeb12090f39592e992b9c86d206d02f6bd03ebec60f072"
],
"version": "==1.5.1"
},
"mypy-extensions": {
"hashes": [
"sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d",
"sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"
],
"version": "==0.4.3"
},
"packaging": {
"hashes": [
"sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb",
"sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"
],
"markers": "python_version >= '3.6'",
"version": "==21.3"
},
"pyparsing": {
"hashes": [
"sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb",
"sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"
],
"markers": "python_full_version >= '3.6.8'",
"version": "==3.0.9"
},
"typing-extensions": {
"hashes": [
"sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02",
"sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6"
],
"markers": "python_version >= '3.7'",
"version": "==4.3.0"
},
"typing-inspect": {
"hashes": [
"sha256:047d4097d9b17f46531bf6f014356111a1b6fb821a24fe7ac909853ca2a782aa",
"sha256:3cd7d4563e997719a710a3bfe7ffb544c6b72069b6812a02e9b414a8fa3aaa6b",
"sha256:b1f56c0783ef0f25fb064a01be6e5407e54cf4a4bf4f3ba3fe51e0bd6dcea9e5"
],
"version": "==0.7.1"
}
},
"develop": {}
}