Skip to content

updates for Python 3.11 - #192

Merged
galgeek merged 9 commits into
masterfrom
Py311
Sep 27, 2023
Merged

updates for Python 3.11#192
galgeek merged 9 commits into
masterfrom
Py311

Conversation

@galgeek

@galgeek galgeek commented Sep 12, 2023

Copy link
Copy Markdown
Contributor

No description provided.

@galgeek galgeek changed the title Draft: updates for Python 3.11 updates for Python 3.11 Sep 19, 2023
@galgeek galgeek self-assigned this Sep 19, 2023
@vbanos

vbanos commented Sep 22, 2023

Copy link
Copy Markdown
Contributor

If we are dropping support for python <3.8, we can make many more improvements. E.g.
from __future__ import absolute_import is not needed any more.

Also, all class definitions that are like class PlaybackIndexDb(object) could be become class PlaybackIndexDb

Finally, we'll be able to use f-strings which improve readability a lot (that's a big change, I don't suggest doing it now).

@vbanos

vbanos commented Sep 22, 2023

Copy link
Copy Markdown
Contributor

What is the python version used when you run tests/run-all-tests.sh
I see libpython2.7-dev libpython3-dev and a very old pip version pip-9.0.1.tar.gz in https://github.com/internetarchive/warcprox/blob/Py311/tests/Dockerfile
Maybe you need to update this as well.

@vbanos

vbanos commented Sep 22, 2023

Copy link
Copy Markdown
Contributor

The benchmarks use a very old version of aiohttp. https://github.com/internetarchive/warcprox/blob/Py311/benchmarks/requirements.txt
Does it work with py311 ?
Maybe you can update it as well https://pypi.org/project/aiohttp/#history

@vbanos

vbanos commented Sep 22, 2023

Copy link
Copy Markdown
Contributor

I got this branch in my computer, I installed using pip install . in my existing py38 venv and got the following error when trying to run it. Thank you.

/opt/spn/lib/python3.8/site-packages/rethinkdb-2.3.0.post6-py3.8.egg/rethinkdb/net.py:312: SyntaxWarning: "is not" with a literal. Did you mean "!="?
/opt/spn/lib/python3.8/site-packages/rethinkdb-2.3.0.post6-py3.8.egg/rethinkdb/net.py:312: SyntaxWarning: "is not" with a literal. Did you mean "!="?
Traceback (most recent call last):
  File "/opt/spn/bin/warcprox", line 5, in <module>
    from warcprox.main import main
  File "/opt/spn/lib/python3.8/site-packages/warcprox/__init__.py", line 276, in <module>
    import warcprox.stats as stats
  File "/opt/spn/lib/python3.8/site-packages/warcprox/stats.py", line 32, in <module>
    from rethinkdb import RethinkDB; r = RethinkDB()
ImportError: cannot import name 'RethinkDB' from 'rethinkdb' (/opt/spn/lib/python3.8/site-packages/rethinkdb-2.3.0.post6-py3.8.egg/rethinkdb/__init__.py)

@galgeek

galgeek commented Sep 25, 2023

Copy link
Copy Markdown
Contributor Author

It looks like pip failed to install the updated dependency, rethinkdb v.2.49, from doublethink.

I wonder if you have better luck creating a new virtualenv?

@galgeek

galgeek commented Sep 25, 2023

Copy link
Copy Markdown
Contributor Author

A draft update to the benchmarks is in PR #193

@galgeek

galgeek commented Sep 26, 2023

Copy link
Copy Markdown
Contributor Author

An earlier PR, #181, updates warcprox tests for github actions. It includes output from running against Python 3.11.2 that look good.

@vbanos

vbanos commented Sep 26, 2023

Copy link
Copy Markdown
Contributor

I created a new virtualenv and pip install . worked. Thank you.

@galgeek
galgeek merged commit 4cb8e0d into master Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants