Open yukihiko-shinoda opened 2 years ago
@yukihiko-shinoda It is possible that you need to pipenv run pip install pbr>=2.0.0
ahead of this becuase of the hacking setup.py may depend on it to generate the metdata: https://opendev.org/openstack/hacking/src/branch/master/setup.py#L19
I would see if that helps and report back.
@matteius Thanks for quick response, unfortunately it had no effect.
@yukihiko-shinoda I was unable to reproduce the issue on the main branch on latest ubuntu:
matteius@matteius-VirtualBox:~/pipenv-triage/issue-5377$ cat Pipfile.lock
{
"_meta": {
"hash": {
"sha256": "22a80b60e6bf5f453ac351a00086fe5f920eaf7e2268988843e93463bc492cc7"
},
"pipfile-spec": 6,
"requires": {},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"d2to1": {
"hashes": [
"sha256:49ef2d16862b3efdc81fc5c32eac373b984945cde5fc02bb01a0a11ff03dd825"
],
"version": "==0.2.12.post1"
},
"flake8": {
"hashes": [
"sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db",
"sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"
],
"index": "pypi",
"version": "==5.0.4"
},
"hacking": {
"hashes": [
"sha256:5cd4b4080d3e9c73113826426052161902940ce8b8aeba089f25204159bf8b30"
],
"index": "pypi",
"version": "==0.5.4"
},
"invoke": {
"hashes": [
"sha256:41b428342d466a82135d5ab37119685a989713742be46e42a3a399d685579314",
"sha256:d9694a865764dd3fd91f25f7e9a97fb41666e822bbb00e670091e3f43933574d"
],
"index": "pypi",
"version": "==1.7.3"
},
"mccabe": {
"hashes": [
"sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325",
"sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"
],
"markers": "python_version >= '3.6'",
"version": "==0.7.0"
},
"pbr": {
"hashes": [
"sha256:cfcc4ff8e698256fc17ea3ff796478b050852585aa5bae79ecd05b2ab7b39b9a",
"sha256:da3e18aac0a3c003e9eea1a81bd23e5a3a75d745670dcf736317b7d966887fdf"
],
"markers": "python_version >= '2.6'",
"version": "==5.10.0"
},
"pycodestyle": {
"hashes": [
"sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785",
"sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"
],
"markers": "python_version >= '3.6'",
"version": "==2.9.1"
},
"pyflakes": {
"hashes": [
"sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2",
"sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"
],
"markers": "python_version >= '3.6'",
"version": "==2.5.0"
},
"setuptools": {
"hashes": [
"sha256:1b6bdc6161661409c5f21508763dc63ab20a9ac2f8ba20029aaaa7fdb9118012",
"sha256:3050e338e5871e70c72983072fe34f6032ae1cdeeeb67338199c2f74e083a80e"
],
"markers": "python_version >= '3.7'",
"version": "==65.4.1"
}
},
"develop": {}
}
matteius@matteius-VirtualBox:~/pipenv-triage/issue-5377$ cat Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
invoke = "1.7.1"
hacking = "4.1.0"
flake8 = "5.0.4"
[dev-packages]
@yukihiko-shinoda Perhaps verify you have the latest setuptools installed in your environment before locking? I'm guessing here since I wasn't able to reproduce it.
@matteius I'm testing by Docker and Python official images: python - Official Image | Docker Hub
1. Prepare 2 files:
docker-compose.yml
Dockerfile
docker-compose.yml
:
version: '3.9'
services:
pipenv:
build: .
entrypoint: bash
Dockerfile
:
FROM python:3.10.7-bullseye
RUN pip install setuptools==65.4.1
2. Build Docker image and run Docker container:
docker compose build --no-cache && docker compose run --rm pipenv
Then you can test Python, pip, and can install Pipenv.
I tested with some Pipenv Versions:
Pipenv version | result |
---|---|
2022.9.24 | NG |
2022.8.30 | NG |
2022.8.24 | NG |
2022.8.5 | NG |
2022.7.24 | NG |
2022.7.4 | OK |
2022.6.7 | OK |
2022.5.2 | OK |
Additionally, also tryed with slim image.
Dockerfile
:
FROM python:3.10.7-slim-bullseye
RUN pip install setuptools==65.4.1
Pipenv version | result |
---|---|
2022.9.24 | NG |
2022.8.31 | NG |
2022.8.30 | NG |
2022.8.24 | OK |
2022.8.17 | OK |
2022.8.5 | OK |
2022.6.7 | NG |
2022.5.2 | NG |
2022.4.30 | OK |
These results indicate that Pipenv may depend some function of OS.
pip list
I tested with following packages and specific version of Pipenv:
Package Version
---------------- ---------
certifi 2022.9.24
distlib 0.3.6
filelock 3.8.0
pip 22.2.2
pipenv
platformdirs 2.5.2
setuptools 65.4.1
virtualenv 20.16.5
virtualenv-clone 0.5.7
wheel 0.37.1
@matteius Turned out, why it can't reproduce is that I mistaked to pin version in Pipfile
:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
- invoke = "1.7.1"
+ invoke = "==1.7.1"
- hacking = "4.1.0"
+ hacking = "==4.1.0"
- flake8 = "5.0.4"
+ flake8 = "==5.0.4"
[dev-packages]
Then, I fixed the first comment so that you finally can reproduce this issue.
As you mentioned, Installing pbr
was effective for this issue, however it requires appropriate version and it doesn't reqire when removing virtualenv.
@yukihiko-shinoda good to hear -- the work I have been doing in #5366 will support this better because you'll be able to define other package groups such as prereqs, and you can manage the version of pbr or other packages that need to be installed ahead of your default group.
@yukihiko-shinoda Named package categories was released and can be used to install pbr
with a specifier as a prerequisite category ahead of the default packages group. For more information: https://pipenv.pypa.io/en/latest/basics/#specifying-package-categories
Please let me know if this issue requires any additional follow-up.
@matteius Remaining issues:
pbr
, Pipenv doesn't display appropriate error message so that user can't use the solution of named package categories.pdr
is not required if virtualenv is removed.Thanks for enhancing logs, I could investigate more and found causes, hacking==4.1.0
depends flake8<3.9.0,>=3.8.0
which confricts with flake8==5.0.4
see: https://opendev.org/openstack/hacking/src/tag/4.1.0/requirements.txt
The invoke==1.7.1
was not involved with this issue.
If error message updated clear, it can expect to reduce GitHub Issues and inquiry.
Issue description
Fail to
pipenv update
due topipenv.patched.pip._internal.exceptions.MetadataGenerationFailed: metadata generation failed
.Expected result
Succeed to update.
Actual result
Failed to update:
console output
```console Reporter.adding_requirement(SpecifierRequirement('pbr<0.6,>=0.5.10'), LinkCandidate('https://files.pythonhosted.org/packages/03/c7/88bcce36996cc902d0f863c77596127cb76d9f9a2ac3c3dab47b36fd69ba/hacking-0.6.0.tar.gz (from https://pypi.org/simple/hacking/)')) INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('pbr<0.6,>=0.5.10'), LinkCandidate('https://files.pythonhosted.org/packages/03/c7/88bcce36996cc902d0f863c77596127cb76d9f9a2ac3c3dab47b36fd69ba/hacking-0.6.0.tar.gz (from https://pypi.org/simple/hacking/)')) ERROR:pip.subprocessor:[present-rich] python setup.py egg_info exited with 1 Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_internal/operations/build/metadata_legacy.py", line 64, in generate_metadata call_subprocess( File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_internal/utils/subprocess.py", line 224, in call_subprocess raise error pipenv.patched.pip._internal.exceptions.InstallationSubprocessError: python setup.py egg_info exited with 1 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 687, in resolve results = resolver.resolve(self.constraints, check_supported_wheels=False) File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve result = self._result = resolver.resolve( File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 373, in resolve failure_causes = self._attempt_to_pin_criterion(name) File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion criteria = self._get_updated_criteria(candidate) File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 204, in _get_updated_criteria self._add_to_criteria(criteria, requirement, parent=candidate) File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 172, in _add_to_criteria if not criterion.candidates: File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/resolvelib/structs.py", line 151, in __bool__ return bool(self._sequence) File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__ return any(self) File "/usr/local/lib/python3.10/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, inSteps to replicate
1. Create Pipfile:
2. Lock:
Then, hacking is locked as v0.5.4 in Pipfile.lock:
3. Sync:
4. Update:
When remove virtualenv, you can update without error:
Or, you can also update by install
pbr<0.6
into venv:$ pipenv --support
Pipenv version: `'2022.9.24'` Pipenv location: `'/usr/local/lib/python3.10/site-packages/pipenv'` Python location: `'/usr/local/bin/python'` OS Name: `'posix'` User pip version: `'22.2.2'` user Python installations found: - `3.10.7`: `/usr/local/bin/python` - `3.10.7`: `/usr/local/bin/python3` - `3.9.2`: `/usr/bin/python3.9` - `3.9.2`: `/usr/bin/python3` PEP 508 Information: ``` {'implementation_name': 'cpython', 'implementation_version': '3.10.7', 'os_name': 'posix', 'platform_machine': 'x86_64', 'platform_python_implementation': 'CPython', 'platform_release': '5.10.102.1-microsoft-standard-WSL2', 'platform_system': 'Linux', 'platform_version': '#1 SMP Wed Mar 2 00:30:59 UTC 2022', 'python_full_version': '3.10.7', 'python_version': '3.10', 'sys_platform': 'linux'} ``` System environment variables: - `SHELL` - `COLORTERM` - `TERM_PROGRAM_VERSION` - `HOSTNAME` - `PYTHON_VERSION` - `SSH_AUTH_SOCK` - `REMOTE_CONTAINERS_IPC` - `PWD` - `PYTHON_SETUPTOOLS_VERSION` - `VSCODE_GIT_ASKPASS_NODE` - `HOME` - `LANG` - `REMOTE_CONTAINERS` - `GPG_KEY` - `GIT_ASKPASS` - `VSCODE_GIT_ASKPASS_EXTRA_ARGS` - `TERM` - `REMOTE_CONTAINERS_SOCKETS` - `VSCODE_GIT_IPC_HANDLE` - `SHLVL` - `PYTHON_PIP_VERSION` - `PYTHON_GET_PIP_SHA256` - `VSCODE_GIT_ASKPASS_MAIN` - `PYTHON_GET_PIP_URL` - `BROWSER` - `PATH` - `TERM_PROGRAM` - `VSCODE_IPC_HOOK_CLI` - `_` - `OLDPWD` - `PIP_DISABLE_PIP_VERSION_CHECK` - `PIP_PYTHON_PATH` - `PYTHONDONTWRITEBYTECODE` - `PYTHONFINDER_IGNORE_UNSUPPORTED` Pipenv–specific environment variables: Debug–specific environment variables: - `PATH`: `/vscode/vscode-server/bin/linux-x64/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/bin/remote-cli:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin` - `SHELL`: `/bin/bash` - `LANG`: `C.UTF-8` - `PWD`: `/workspace` --------------------------- Contents of `Pipfile` ('/workspace/Pipfile'): ```toml [[source]] url = "https://pypi.org/simple" verify_ssl = true name = "pypi" [packages] hacking = "*" flake8 = "==5.0.4" [dev-packages] ``` Contents of `Pipfile.lock` ('/workspace/Pipfile.lock'): ```json { "_meta": { "hash": { "sha256": "cce9d5eae6e8b47e3f7d9af1a7835c24d4cd0c9641f398cb5e6c87292e581e98" }, "pipfile-spec": 6, "requires": {}, "sources": [ { "name": "pypi", "url": "https://pypi.org/simple", "verify_ssl": true } ] }, "default": { "d2to1": { "hashes": [ "sha256:49ef2d16862b3efdc81fc5c32eac373b984945cde5fc02bb01a0a11ff03dd825" ], "version": "==0.2.12.post1" }, "flake8": { "hashes": [ "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db", "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248" ], "index": "pypi", "version": "==5.0.4" }, "hacking": { "hashes": [ "sha256:5cd4b4080d3e9c73113826426052161902940ce8b8aeba089f25204159bf8b30" ], "index": "pypi", "version": "==0.5.4" }, "mccabe": { "hashes": [ "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e" ], "markers": "python_version >= '3.6'", "version": "==0.7.0" }, "pbr": { "hashes": [ "sha256:cfcc4ff8e698256fc17ea3ff796478b050852585aa5bae79ecd05b2ab7b39b9a", "sha256:da3e18aac0a3c003e9eea1a81bd23e5a3a75d745670dcf736317b7d966887fdf" ], "markers": "python_version >= '2.6'", "version": "==5.10.0" }, "pycodestyle": { "hashes": [ "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785", "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b" ], "markers": "python_version >= '3.6'", "version": "==2.9.1" }, "pyflakes": { "hashes": [ "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2", "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3" ], "markers": "python_version >= '3.6'", "version": "==2.5.0" }, "setuptools": { "hashes": [ "sha256:1b6bdc6161661409c5f21508763dc63ab20a9ac2f8ba20029aaaa7fdb9118012", "sha256:3050e338e5871e70c72983072fe34f6032ae1cdeeeb67338199c2f74e083a80e" ], "markers": "python_version >= '3.7'", "version": "==65.4.1" } }, "develop": {} } ```