autobahn-python
autobahn-python copied to clipboard
Switch to log.warning instead of log.warn
log.warn is removed in Python 3.13
Close #1098
From what I understand of the error, I may be completely wrong on how to solve this: I seem to have modified calls to twited Logger class which does use warn. So the issue about warn being deprecated may come from a dependency and not this packages directly (nor txaio).
Testing this properly is made harder by the fact that pyunormalize cannot be installed on Python 3.13 yet
Any insights no this?
thanks for taking care of such things .. pls lemme comment ..
log.warn is removed in Python 3.13
if so, then
- the CI in Autobahn should first be upgraded to 3.13 in an independent PR
- this should then run red (fail), because the function is removed
once that is done, this PR can continue ..
right now, 3.13 is not yet released
currently, the CI uses CPython 3.11 and PyPy 3.9
https://github.com/crossbario/autobahn-python/blob/7bc85b34e200640ab98a41cfddb38267f39bc92e/.github/workflows/main.yml#L60
and PyPy is now at 3.10
https://pypy.org/download.html
for the CI upgrade PR, we should first define the exact version goals for CPython and for PyPy ..
Sounds good to me. I started looking into it because fedora is starting to switch to 3.13 in its dev version and it seemed easy to do (sadly I was proven wrong).
But, yes, we can wait for Python 3.13 to be officially release and migrate the CI first.
But, yes, we can wait for Python 3.13 to be officially release and migrate the CI first.
I'm confident this ordering will support Autobahn's goal of improving robustness & production stability.
if there is an issue in Autobahn triggered by a dependency upgrade, the issue should first be proven to actually exist and be valid
this requires the CI to first not touch any code, but only upgrade the dependency, and then demoonstrate at least one failing test (which previously worked).
if no such test currently exists which can demonstrate the issue, a new test case should be added
once the issue is confirmed (by a test that transitioned from GREEN to RED), the issue can be fixed in another PR
this allows to exactly follow the sequence of events with proof at each step, and the option for relatively easy rollback should something go wrong. as there will more often than not in reality;)
like ripples in a subsequent, dependent project like Crossbar.io (which obviously uses Autobahn a lot) ..
Python 3.13 is out. Time to move on?
@yan12125 wau. you are quick;) I also saw that flying by. so yes: +1!
maybe worth: I think it would be good to first (and only that) switch from 3.11 to 3.13 everywhere in CI etc, e.g.
https://github.com/crossbario/autobahn-python/blob/7bc85b34e200640ab98a41cfddb38267f39bc92e/.github/workflows/main.yml#L28
and once that runs, only then move on to the log issue (the original itch of this issue), and this PR
in other words, what I am saying is: it might be worth doing the 3.11 to 3.13 switch (and only that) in a (new) separate PR
this latter (new) PR should be all green immediately. in theory. I don't believe it. sadly.
then this PR can simply catch up with / merge main to have 3.13
it will then run as is right away, and we'll see what is yet missing then ...
sounds like a good / workable plan?
Sounds good. I can work on 3.11 -> 3.13 switch if you wish.
Sounds good. I can work on 3.11 -> 3.13 switch if you wish.
I started a work-in-progress: https://github.com/yan12125/autobahn-python/commits/python-3.13/
The linked issue https://github.com/crossbario/autobahn-python/issues/1098 mentions:
FYI,
logger.warnis removed in Python 3.13: https://docs.python.org/3.13/whatsnew/3.13.html#logging
That page on Python official website actually places logging.warn in the section "Pending Removal in Future Versions", so that function is still in Python 3.13. Also, Python 3.13 unit tests passed without changes in this pull request: https://github.com/yan12125/autobahn-python/actions/runs/11666669688.
@Jenselme could you check how to make deprecation warnings visible in unit tests?
@yan12125 I’m already seeing the warnings:
.tox/py3.11-asyncio/lib64/python3.11/site-packages/websockets/legacy/__init__.py:6
/home/jenselme/Projects/_Clones/autobahn-python/.tox/py3.11-asyncio/lib64/python3.11/site-packages/websockets/legacy/__init__.py:6: DeprecationWarning: websockets.legacy is deprecated; see https://websockets.readthedocs.io/en/stable/howto/upgrade.html for upgrade instructions
warnings.warn( # deprecated in 14.0
It’s still not easy to spot where the issue comes from though.
@yan12125 I’m already seeing the warnings:
.tox/py3.11-asyncio/lib64/python3.11/site-packages/websockets/legacy/__init__.py:6 /home/jenselme/Projects/_Clones/autobahn-python/.tox/py3.11-asyncio/lib64/python3.11/site-packages/websockets/legacy/__init__.py:6: DeprecationWarning: websockets.legacy is deprecated; see https://websockets.readthedocs.io/en/stable/howto/upgrade.html for upgrade instructions warnings.warn( # deprecated in 14.0
Thanks, but the warning is about warnings.warn, not log.warning .
It’s still not easy to spot where the issue comes from though.
You may check it by running export PYTHONWARNINGS=error first.
Currently, the test suite fails to run with Python 3.13 because of https://github.com/jnwatson/py-lmdb/issues/362 Will try to monitor this issue and come back to this once it’s solved.
ah, right. thanks for digging! the PR https://github.com/jnwatson/py-lmdb/pull/368 claims to solve that, so let's wait and see, yeah.
https://github.com/jnwatson/py-lmdb/pull/368 was merged and I know of no issue with log.warn. Closing. Sorry for the noise.