Reimplement strtobool for Python 3.12 compatibility (SVRENG-267) #68
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.
What and why?
distutils
was removed in Python 3.12, which meansdistutils.util.strtobool
got removed along with it. The guidance from PEP-632--which laid the foundation to deprecatedistutils
--was to reimplement thestrtobool
(or other functions not directly addressed by the text of the PEP.This PR does just that, using CPython 3.11's
distutils
as a reference, and uses the implementation ofstrtobool
along with its test to form the basis for the function within a utility module.Additionally, this PR:
I
set of rules is enabled; here, we simply extend the default set vialint.extend-select
.pytest
as a dev dependency, and adds pytest into the Makefile and GitHub Actions workflows as appropriate.Finally, the version is bumped to 0.8.16, so we can have a clear marker of which version supports Python 3.12. That said, 0.8.15 is still compatible on CLI workers with boardwalkd running 0.8.16.
Resolves #67.
Backblaze internal tracking: SVRENG-267
How was this tested?
make test
; using theShouldSucceedTestWorkspace
andShouldFailTestWorkspace
against the local development server and both test workspaces functioned as they are intended.Checklist