graphix icon indicating copy to clipboard operation
graphix copied to clipboard

Support Python3.12

Open masa10-f opened this issue 1 year ago • 5 comments

Describe the feature you'd like

Graphix currently supports Python 3.8 through 3.11. Python 3.12 was released last October, so It would be beneficial to support 3.12.

Additional context

I would like to have criteria for when to add new Python versions and when to drop older ones. It seems reasonable to me to follow the status of Python versions. Following this, we will drop the oldest next October and add the latest once released. If anyone has opinions or suggestions, please share them in this issue.

masa10-f avatar Apr 05 '24 12:04 masa10-f

@masa10-f thanks, I think it might also make sense to discontinue 3.9 as well which will be end-of-life in a year or so (and according to @thierry-martinez we can have more organized code writing by restricting to 3.10+)

shinich1 avatar Apr 08 '24 01:04 shinich1

Can I work on this?

we can have more organized code

I suspect it's based on the match syntax. Actually it's possible to switch implementation based on version like this: (memo: it may cause black to fail, since now it's based on py38 profile.)

if sys.version_info >= (3, 9):
    TestCaseType = dict[str, dict[str, tuple[bool, dict[int, set[int]]]]]
else:
    TestCaseType = Dict[str, Dict[str, Tuple[bool, Dict[int, Set[int]]]]]

EarlMilktea avatar May 09 '24 04:05 EarlMilktea

@EarlMilktea Thanks for you comment! I didn't know that

@shinich1 Dropping support for 3.9 seems a bit excessive because physicists do not update python versions frequently. I think updating python version is not so convinient as with other languages. Looking at other quantum software, it seems reasonable to support the latest 4 versions, and I agree with that. What do you think about?

masa10-f avatar May 10 '24 00:05 masa10-f

@EarlMilktea Thanks for you comment! I didn't know that

@shinich1 Dropping support for 3.9 seems a bit excessive because physicists do not update python versions frequently. I think updating python version is not so convinient as with other languages. Looking at other quantum software, it seems reasonable to support the latest 4 versions, and I agree with that. What do you think about?

that sounds good, yeah if we have good way around switch syntax, dropping only 3.8 seems reasonable.

shinich1 avatar May 10 '24 00:05 shinich1

support the latest 4 versions

Let me point out that this is due to the EOL policy of Python, which guarantees security supports for 5 years. So I recommend to deprecate 3.8 after 31 Oct 2024.

MEMO: https://endoflife.date/python

EarlMilktea avatar May 10 '24 03:05 EarlMilktea

I managed to pass the tests with looser numpy version requirement.

EarlMilktea avatar Jun 10 '24 01:06 EarlMilktea