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
Remove Python 2 datetime compat fallbacks #81874
base: devel
Are you sure you want to change the base?
Remove Python 2 datetime compat fallbacks #81874
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
b64732e
to
4d16dc3
Compare
4d16dc3
to
a36fdaa
Compare
a36fdaa
to
4875507
Compare
This comment was marked as resolved.
This comment was marked as resolved.
4875507
to
f6f8075
Compare
f6f8075
to
4c9b5e5
Compare
This comment was marked as resolved.
This comment was marked as resolved.
0b5fcdb
to
b6c3f8d
Compare
b6c3f8d
to
886af13
Compare
So the CI failure is 01:24 _____________________ test_deprecate_without_list[stdin0] ______________________
01:24 [gw0] linux -- Python 3.12.0 /usr/bin/python3.12
01:24
01:24 am = <ansible.module_utils.basic.AnsibleModule object at 0x7fca11c53530>
01:24 capfd = <_pytest.capture.CaptureFixture object at 0x7fca11c2dfd0>
01:24
01:24 @pytest.mark.parametrize('stdin', [{}], indirect=['stdin'])
01:24 def test_deprecate_without_list(am, capfd):
01:24 with pytest.raises(SystemExit):
01:24 am.exit_json(deprecations='Simple deprecation warning')
01:24
01:24 out, err = capfd.readouterr()
01:24 output = json.loads(out)
01:24 E
01:24 E ...Full output truncated (21 lines hidden), use '-vv' to show
01:24
01:24 test/units/module_utils/basic/test_deprecate_warn.py:67: AssertionError Which is weird because I cannon reproduce it locally with |
Aha.. So $ while :; do if ! bin/ansible-test units --docker --python 3.12 -vvvvvv --debug -- test/units/module_utils/; then break; fi; done |
Reduced the repro to $ while :; do if ! bin/ansible-test units --docker --python 3.12 -vvvvvv --debug -- test/units/module_utils/basic/test_deprecate_warn.py test/units/module_utils/compat/test_datetime.py; then break; fi; done |
Apparently, |
886af13
to
16354c1
Compare
@mattclay should we only deprecate the |
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's too early to deprecate this, since collections may need it for compatibility across multiple non-EOL versions of ansible-core. Instead of deprecating it, add a deprecated comment (detected by pylint) so we can defer deprecation until 2.16 (the first version with this module_util) is the oldest non-EOL version.
@mattclay so I wasn't sure about deprecating since most of these aren't exact implementations of what's in stdlib. |
SUMMARY
$sbj.
ISSUE TYPE
ADDITIONAL INFORMATION
N/A