-
-
Notifications
You must be signed in to change notification settings - Fork 404
Why does pdm download lots of different versions of the same library? #1664
-
Run |
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment · 5 replies
-
First, this command is incomplete:
It works fine after I fixed it, no extra packages are downloaded $ pdm add -dGlint mypy -v
Adding packages to lint dev-dependencies: mypy
STATUS: Resolving dependencies
pdm.termui: ======== Start resolving requirements ========
pdm.termui: mypy
pdm.termui: python>=3.10
pdm.termui: Adding requirement mypy
pdm.termui: Adding requirement python>=3.10
pdm.termui: ======== Starting round 0 ========
STATUS: Resolving: new pin python>=3.10
pdm.termui: Pinning: python None
pdm.termui: ======== Ending round 0 ========
pdm.termui: ======== Starting round 1 ========
unearth.preparer: Downloading <Link https://files.pythonhosted.org/packages/87/ec/62fd00fa5d8ead3ecafed3eb99ee805911f41b11536c5940df1bcb2c845d/mypy-0.991-cp310-cp310-macosx_11_0_arm64.whl (from https://pypi.org/simple/mypy/)> (10.0 MB)
pdm.termui: Adding requirement typing-extensions>=3.10(from mypy 0.991)
pdm.termui: Adding requirement mypy-extensions>=0.4.3(from mypy 0.991)
pdm.termui: Adding requirement tomli>=1.1.0; python_version < "3.11"(from mypy 0.991)
STATUS: Resolving: new pin mypy 0.991
pdm.termui: Pinning: mypy 0.991
pdm.termui: ======== Ending round 1 ========
pdm.termui: ======== Starting round 2 ========
unearth.preparer: Downloading <Link https://files.pythonhosted.org/packages/5c/eb/975c7c080f3223a5cdaff09612f3a5221e4ba534f7039db34c35d95fa6a5/mypy_extensions-0.4.3-py2.py3-none-any.whl (from https://pypi.org/simple/mypy-extensions/)> (4.5 kB)
STATUS: Resolving: new pin mypy-extensions 0.4.3
pdm.termui: Pinning: mypy-extensions 0.4.3
pdm.termui: ======== Ending round 2 ========
pdm.termui: ======== Starting round 3 ========
unearth.preparer: Downloading <Link https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl (from https://pypi.org/simple/tomli/)> (12 kB)
STATUS: Resolving: new pin tomli 2.0.1
pdm.termui: Pinning: tomli 2.0.1
pdm.termui: ======== Ending round 3 ========
pdm.termui: ======== Starting round 4 ========
unearth.preparer: Downloading <Link https://files.pythonhosted.org/packages/0b/8e/f1a0a5a76cfef77e1eb6004cb49e5f8d72634da638420b9ea492ce8305e8/typing_extensions-4.4.0-py3-none-any.whl (from https://pypi.org/simple/typing-extensions/)> (26 kB)
STATUS: Resolving: new pin typing-extensions 4.4.0
pdm.termui: Pinning: typing-extensions 4.4.0
pdm.termui: ======== Ending round 4 ========
pdm.termui: ======== Starting round 5 ========
pdm.termui: ======== Resolution Result ========
pdm.termui: Stable pins:
pdm.termui: python None
pdm.termui: mypy 0.991
pdm.termui: mypy-extensions 0.4.3
pdm.termui: tomli 2.0.1
pdm.termui: typing-extensions 4.4.0
STATUS: Fetching hashes for resolved packages...
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
🔒 Lock successful
Changes are written to pdm.lock.
Changes are written to pyproject.toml.
STATUS: Resolving packages from lockfile...
STATUS: Fetching hashes for resolved packages...
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
pdm.termui: Fetching hashes for [email protected]
Synchronizing working set with lock file: 4 to add, 0 to update, 0 to remove
unearth.preparer: Using cached <Link https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl (from None)>
unearth.preparer: Using cached <Link https://files.pythonhosted.org/packages/0b/8e/f1a0a5a76cfef77e1eb6004cb49e5f8d72634da638420b9ea492ce8305e8/typing_extensions-4.4.0-py3-none-any.whl (from None)>
unearth.preparer: Using cached <Link https://files.pythonhosted.org/packages/5c/eb/975c7c080f3223a5cdaff09612f3a5221e4ba534f7039db34c35d95fa6a5/mypy_extensions-0.4.3-py2.py3-none-any.whl (from None)>
unearth.preparer: Using cached <Link https://files.pythonhosted.org/packages/87/ec/62fd00fa5d8ead3ecafed3eb99ee805911f41b11536c5940df1bcb2c845d/mypy-0.991-cp310-cp310-macosx_11_0_arm64.whl (from None)>
✔ Install tomli 2.0.1 successful
✔ Install mypy-extensions 0.4.3 successful
✔ Install typing-extensions 4.4.0 successful
✔ Install mypy 0.991 successful
🎉 All complete! |
Beta Was this translation helpful? Give feedback.
All reactions
-
I tried again, and it seems that it can only be reproduced in this pyproject.toml, the following is the log. [project]
name = "xing"
version = "1.0.0"
description = "An easy-to-use web framework."
authors = [{ name = "abersheeran", email = "[email protected]" }]
dependencies = [
"baize<0.19.0,>=0.18.2",
"pydantic<2.0,>=1.8",
"typing-extensions>=3.10.0",
]
requires-python = ">=3.7,<4.0"
readme = "README.md"
license = { text = "Apache-2.0" }
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
]
[project.urls]
homepage = "https://github.com/abersheeran/xing"
repository = "https://github.com/abersheeran/xing"
documentation = "https://xing.abersheeran.com/"
[project.optional-dependencies]
cli = ["click<9.0,>=8.0"]
[project.scripts]
xing = "xing.cli:main"
[tool.pdm]
[tool.pdm.dev-dependencies]
dev = [
"flake8",
"black",
"isort",
"mypy @ git+https://github.com/python/mypy.git",
]
test = [
"async-asgi-testclient<2.0.0,>=1.4.11",
"pytest<8.0.0,>=7.2.1",
"pytest-asyncio<1.0,>=0.20.3",
"pytest-cov<5.0.0,>=4.0.0",
]
docs = [
"mkdocs[i18n]<2.0.0,>=1.4.2",
"mkdocs-material<10.0.0,>=9.0.10",
"mkdocs-static-i18n<1.0,>=0.53",
]
[tool.pdm.build]
includes = ["xing"]
[build-system]
requires = ["pdm-pep517>=1.0.0"]
build-backend = "pdm.pep517.api"
|
Beta Was this translation helpful? Give feedback.
All reactions
-
It seems that the dependencies of mkdocs and flake8 conflict, but why does pdm always drop the version of irrelevant dependencies? It was mypy before, this time it is isort. |
Beta Was this translation helpful? Give feedback.
All reactions
-
The log shows a different error cause from what you orignally posted, the conflict happens between |
Beta Was this translation helpful? Give feedback.
All reactions
-
It is because
The resolver only back jumps one step each time it encounters a conflict. For the optimization of this algorithm, you may be interested in sarugaku/resolvelib#113 |
Beta Was this translation helpful? Give feedback.
All reactions
-
Just because I changed mypy from pypi to git …… was I still using mypy 0.991 at the time I asked the question, that would cause mypy to keep downloading. |
Beta Was this translation helpful? Give feedback.
First, this command is incomplete:
It works fine after I fixed it, no extra packages are downloaded