-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-3347 Test against Python 3.11 prerelease #1069
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
Conversation
Assuming the 3.11 tests pass let's add the 3.11 trove classifier too. |
Failures that were pre-existing in recent build:
New failures:
|
Interesting, is this a fluke or does it happen consistently? |
I kicked the task and it passed |
test/test_bson.py
Outdated
) | ||
# The repr() of an enum changed in Python 3.11. | ||
if sys.version_info >= (3, 11): | ||
r = r.replace("DatetimeConversion.DATETIME", str(DatetimeConversion.DATETIME)) |
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.
We should fix CodecOptions.__repr__
to avoid changing behavior.
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.
Also do you know if this was an intentional change? Could it be a python bug?
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.
We're actually using the str()
representation, and it is an intentional change:
IntEnum
used to subclass int, Enum
and now it subclasses int, ReprEnum
.:
"Changed in version 3.11: str() is now int.str() to better support the replacement of existing constants use-case. format() was already int.format() for that same reason."
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.
can we use format (f-string) instead?
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.
I don't think so. If we had been going the other direction we could have specified int()
formatting, but we'd have to basically recreate the old str()
repr ourselves:
f'{DatetimeConversion.DATETIME_AUTO}'
'4'
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.
I think we can use class DatetimeConversion(int, enum.Enum)
to keep the old behavior.
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.
Done
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.
One last question
This error was fixed by PYTHON-3451. |
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.
Could we merge this PR and push out the 3.11 gevent testing fix and the 3.11 macos wheels to a new ticket?
.evergreen/run-tests.sh
Outdated
# Install the framework from pip. | ||
# Use the same flags as the ones used by gevent, in case we have to build the wheel. | ||
$PYTHON -m pip install --upgrade pip wheel setuptools | ||
$PYTHON -m pip install $GREEN_FRAMEWORK |
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.
Is this using a venv? If not we need to create one first before pip installing anything.
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.
It was not, I'll add a note in the new ticket
Yep, sounds good |
(cherry picked from commit df77653)
No description provided.