Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading PackageWarning when adding a package (myst-nb==1.0.0) with a version free dependency (ipython) whose requires-python range is not satisfied on the latest version #2522

Closed
1 task done
jeertmans opened this issue Dec 26, 2023 · 4 comments · Fixed by #2523
Labels
🐛 bug Something isn't working

Comments

@jeertmans
Copy link
Contributor

  • I have searched the issue tracker and believe that this is not a duplicate.

Steps to reproduce

Just add myst-nb==1.0.0 to any project that has a minimal Python version below or equal to 3.9, like in the screenshot below:

image

Actual behavior

A warning is thrown, when a valid version could be found anyway.

Expected behavior

Just don't raise a warning because that scared me a bit like: do I have dependencies conflicts? Did I do something?

There is no issue that the latest version available may not be compatible with the Python versions you claim to support in the requires-python range. But what's the problem with that?

Environment Information

PDM version:
  2.11.1
Python Interpreter:
  /home/jeertmans/Desktop/install-warning/.venv/bin/python (3.10)
Project Root:
  /home/jeertmans/Desktop/install-warning
Local Packages:
  
{
  "implementation_name": "cpython",
  "implementation_version": "3.10.12",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "6.2.0-39-generic",
  "platform_system": "Linux",
  "platform_version": "#40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 
UTC 2",
  "python_full_version": "3.10.12",
  "platform_python_implementation": "CPython",
  "python_version": "3.10",
  "sys_platform": "linux"
}
@jeertmans jeertmans added the 🐛 bug Something isn't working label Dec 26, 2023
@jeertmans jeertmans changed the title Irrelevant PackageWarning when adding a package (myst-nb==1.0.0) with a version free dependency (ipython) who's require-python range is not satisfied on the latest version Irrelevant PackageWarning when adding a package (myst-nb==1.0.0) with a version free dependency (ipython) who's requires-python range is not satisfied on the latest version Dec 26, 2023
@jeertmans jeertmans changed the title Irrelevant PackageWarning when adding a package (myst-nb==1.0.0) with a version free dependency (ipython) who's requires-python range is not satisfied on the latest version Irrelevant PackageWarning when adding a package (myst-nb==1.0.0) with a version free dependency (ipython) whose requires-python range is not satisfied on the latest version Dec 26, 2023
@frostming
Copy link
Collaborator

frostming commented Dec 27, 2023

This is a frequently asked question by users: Why did it install version 1.24 when the latest version of numpy is 1.26.x? Previously, PDM silently fell back to the old version, but just TOO MANY users were confused about this and didn't understand how requires-python affects the resolution result. You know, most people don't even read the docs and just complain when the result is not as they desired. So I think it's necessary to tell them about this and explain how to use the new version if they want to. The warning can be silenced with -q config or project configuration.

I know people have different expectations on the same result, but please do not interrogate with an unquestionable tone.

@jeertmans
Copy link
Contributor Author

Hello, first my apologies for the tone, I really didn’t want to sound harsh or else.

Thanks for the clarification, I understand know why the warning exists in the first place. I think I didn’t expect it because I previously used Poetry which does not seem to output such kind of warning.

If I may, I would suggest to rephrase a bit the warning like so: latest available version for package P (x.y.z) could not be installed the specified Python version requirements. Instead, the latest version of that package that supports your Python range will be installed.

@frostming
Copy link
Collaborator

If I may, I would suggest to rephrase a bit the warning like so: latest available version for package P (x.y.z) could not be installed the specified Python version requirements. Instead, the latest version of that package that supports your Python range will be installed.

Can you submit a PR for this and I can review.

jeertmans added a commit to jeertmans/pdm that referenced this issue Dec 27, 2023
@jeertmans
Copy link
Contributor Author

If I may, I would suggest to rephrase a bit the warning like so: latest available version for package P (x.y.z) could not be installed the specified Python version requirements. Instead, the latest version of that package that supports your Python range will be installed.

Can you submit a PR for this and I can review.

Sure, done :-)

@jeertmans jeertmans changed the title Irrelevant PackageWarning when adding a package (myst-nb==1.0.0) with a version free dependency (ipython) whose requires-python range is not satisfied on the latest version Misleading PackageWarning when adding a package (myst-nb==1.0.0) with a version free dependency (ipython) whose requires-python range is not satisfied on the latest version Dec 27, 2023
frostming pushed a commit that referenced this issue Jan 2, 2024
* chore(lib): enhance warning message

Closes #2522.

* chore(lib): fix message to be more correct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants