-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add --report argument to __main__.py to omit supported formats #7818
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5b20811
Add `--bugreport` argument to __main__.py to omit supported formats
nulano ab9dfd8
Add sys.{executable,base_prefix,prefix} to features.pilinfo
nulano 89c44be
Mention `python -m PIL --bugreport` in the issue template
nulano ca63a12
Mention features.pilinfo directly in the issue template
nulano 01fdf2f
Merge branch 'main' into bugreport
radarhere 970c691
Document --bugreport
radarhere 4dbc428
list both `python3 -m PIL --bugreport` and `features.pilinfo` in the …
nulano 07f2b96
rename `--bugreport` to `--report`
nulano e5a46ef
add test for --report argument and features.pilinfo(supported_formats)
nulano a619a8d
add PIL.report
nulano ff523e3
Update .github/ISSUE_TEMPLATE/ISSUE_REPORT.md
nulano 7e71621
Update src/PIL/features.py
nulano 1ac1540
Combined test_report.py into test_main.py
radarhere 6b0a79c
sort the parameters
nulano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,27 @@ | ||
from __future__ import annotations | ||
|
||
import subprocess | ||
import sys | ||
|
||
|
||
def test_main() -> None: | ||
args = [sys.executable, "-m", "PIL.report"] | ||
out = subprocess.check_output(args).decode("utf-8") | ||
lines = out.splitlines() | ||
assert lines[0] == "-" * 68 | ||
assert lines[1].startswith("Pillow ") | ||
assert lines[2].startswith("Python ") | ||
lines = lines[3:] | ||
while lines[0].startswith(" "): | ||
lines = lines[1:] | ||
assert lines[0] == "-" * 68 | ||
assert lines[1].startswith("Python executable is") | ||
lines = lines[2:] | ||
if lines[0].startswith("Environment Python files loaded from"): | ||
lines = lines[1:] | ||
assert lines[0].startswith("System Python files loaded from") | ||
assert lines[1] == "-" * 68 | ||
assert lines[2].startswith("Python Pillow modules loaded from ") | ||
assert lines[3].startswith("Binary Pillow modules loaded from ") | ||
assert lines[4] == "-" * 68 | ||
assert "JPEG image/jpeg" not in out |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
|
||
from .features import pilinfo | ||
|
||
pilinfo() | ||
pilinfo(supported_formats="--report" not in sys.argv) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
from .features import pilinfo | ||
|
||
pilinfo(supported_formats=False) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for the record, this happens for... virtual environments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct: https://docs.python.org/3/library/sys.html#sys.base_prefix
I'm not sure if this can also happen outside of a virtual environment, e.g. on Conda, so I didn't want to explicitly state "Virtual Environment Python files...".