Fixes for install
and docs
targets when contributing on Windows
#7282
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.
Change Summary
Tweaks
pyproject.toml
anddocs/plugins/main.py
so that no errors occur when performing common dev tasks like installing, running tests, and building docs on Windows.Install:
Building tests then of course fail because of the missing import:
This can be fixed by simply excluding memray's installation if the installers platform is Windows. This means no memory profiling on Windows, but I would argue that's less important for minimal changes and can always be tested in CI. Not much Pydantic can do about it, in any case.
Making docs also breaks, but for a different reason:
Windows python seems to not want to read the text in "utf-8" by default, which is somewhat bizarre even for Windows. I changed the
read_text()
andwrite_text()
functions to specifyencoding="utf-8"
, which should probably be done for consistency anyway.After these changes, installing, formatting, linting, typechecking, testing, coverage, and building docs all work out of the box on Windows. There are still a few commands that fail (like
test-examples
), but this is less a total conversion PR (and would be much more complex if it was), but instead a pair of fixes so that somebody on Windows who's willing to installmake
could follow along with the contribution page.Maybe the documentation page could now recommend to install
make
if you're on Windows? All the remaining documentation would be unchanged.Checklist
Selected Reviewer: @davidhewitt