Update to workflows to multi-platform testing, latest python#999
Merged
Update to workflows to multi-platform testing, latest python#999
Conversation
…t a test server config issue
kroenlein
commented
Sep 11, 2025
| def _mime_type(file_path: Path): | ||
| # This string coercion is for supporting pathlib.Path objects in python < 3.8 | ||
| mime_type = mimetypes.guess_type(str(file_path))[0] | ||
| mime_type, _ = mimetypes.guess_type(file_path) |
Collaborator
Author
There was a problem hiding this comment.
This is no longer necessary.
kroenlein
commented
Sep 11, 2025
| def test_from_path(): | ||
| """Test the string representation.""" | ||
| path = '/some/path/with/file.txt' | ||
| path = Path.cwd() / 'some' / 'path' / 'with' / 'file.txt' |
Collaborator
Author
There was a problem hiding this comment.
Generates a platform-agnostic absolute path, which is what was necessary for the test.
kroenlein
commented
Sep 11, 2025
Comment on lines
+43
to
+63
| @pytest.mark.parametrize( | ||
| ("filename", "mimetype"), | ||
| [ | ||
| pytest.param( | ||
| "asdf.xlsx", | ||
| "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | ||
| marks=pytest.mark.xfail( | ||
| platform.system() == "Windows", | ||
| reason="windows-latest test servers omit xlsx from their registry", | ||
| strict=True | ||
| ) | ||
| ), | ||
| ("asdf.xls", "application/vnd.ms-excel"), | ||
| ("asdf.XLS", "application/vnd.ms-excel"), | ||
| ("asdf.TXT", "text/plain"), | ||
| ("asdf.csv", "text/csv"), | ||
| ("asdf.FAKE", "application/octet-stream"), | ||
| ], | ||
| ) | ||
| def test_mime_types(collection: FileCollection, filename, mimetype): | ||
| assert collection._mime_type(Path(filename)) == mimetype |
Collaborator
Author
There was a problem hiding this comment.
Test now parameterized. The xlsx tests were failing on windows-latest servers because xlsx was not in the build's registry; shouldn't be possible on a Windows box that can open xlsx files.
- Marked xlsx as strict xfail on Windows, which will alert us if the test server config is updated
- Moved the case-agnostic check over to xls instead, since that should always hold
anoto-moniz
approved these changes
Sep 11, 2025
Collaborator
anoto-moniz
left a comment
There was a problem hiding this comment.
Thanks for the update, Ken!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Citrine Python PR
Description
This PR updates the testing protocol to use v1.1 from common-gh-actions. It also adds 3.13 to the test suite and updates the Python classifiers for the repo.
There should be a fast follow removing claimed support for 3.8 and removing that from the testing.
PR Type:
Adherence to team decisions