-
-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: --quiet optiona and package warning (#2304)
- Loading branch information
Showing
24 changed files
with
253 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,3 +315,28 @@ lock = ["--no-cross-platform"] | |
|
||
These options will be added right after the command name. For instance, based on the configuration above, | ||
`pdm add requests` is equivalent to `pdm add --no-isolation --no-self requests`. | ||
|
||
|
||
## Ignore package warnings | ||
|
||
_New in version 2.10.0_ | ||
|
||
You may see some warnings when resolving dependencies like this: | ||
|
||
``` | ||
PackageWarning: Skipping [email protected] because it requires Python | ||
<3.12,>=3.8 but the project claims to work with Python>=3.9. | ||
Narrow down the `requires-python` range to include this version. For example, ">=3.9,<3.12" should work. | ||
warnings.warn(record.message, PackageWarning, stacklevel=1) | ||
Use `-q/--quiet` to suppress these warnings, or ignore them per-package with `ignore_package_warnings` config in [tool.pdm] table. | ||
``` | ||
|
||
This is because the supported range of Python versions of the package doesn't cover the `requires-python` value specified in the `pyproject.toml`. | ||
You can ignore these warnings in a per-package basis by adding the following config: | ||
|
||
```toml | ||
[tool.pdm] | ||
ignore_package_warnings = ["scipy", "tensorflow-*"] | ||
``` | ||
|
||
Where each item is a case-insensitive glob pattern to match the package name. |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add `-q/--quiet` option to suppress some warnings printed to the console. This option is mutually exclusive with `-v/--verbose`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Show warnings when a package is rejected by the resolve because of uncovered `requires-python` range. And provide a way to ignore them per-package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.