april-tools / cirkit

a python framework to build, learn and reason about probabilistic circuits and tensor networks
https://cirkit-docs.readthedocs.io/en/latest/
GNU General Public License v3.0
80 stars 4 forks source link

Python 3.8 reached end of life (October 2024) #264

Closed loreloc closed 1 month ago

loreloc commented 2 months ago

As suggested by @lkct, upgrade the whole repository to Python 3.9 (EOL Oct 2025) or Python 3.10 (EOL Oct 2026). I guess many things about typing have changed. https://devguide.python.org/versions/

lkct commented 2 months ago

Ref: https://docs.python.org/3/whatsnew/3.9.html

loreloc commented 2 months ago

Perhaps use this just one time to upgrade all the type hints from Python 3.8 to 3.9. https://adamj.eu/tech/2021/05/21/python-type-hints-how-to-upgrade-syntax-with-pyupgrade/ https://github.com/asottile/pyupgrade

lkct commented 2 months ago

Just to note that I have left some # FURURE comments in the repo. Those with the corresponding version can be cleaned every time we move to the next Python version.

loreloc commented 1 month ago

We decided to move directly to Python 3.10. Motivation: 3.10 is the default python version in the oldest Ubuntu LTS version. Also, https://colab.google/articles/py3.10

lkct commented 1 month ago

we might need to double-check, e.g. (main as of today) https://github.com/april-tools/cirkit/blob/1d4f8f3e5f344744a99c936e70ba1798a1fddb7b/cirkit/templates/region_graph/graph.py#L15

re-opening with lo-pri

EDIT: seems pylint can catch this #244

loreloc commented 1 month ago

That one is now fixed in main, but I do not know if there is an automatic way to check for this kind of issues without reading the whole pylint output.

loreloc commented 1 month ago

I am going to close this, since there is no reliable and automatic way to check that we are always using the latest python features.