Skip to content
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

Drop Python 3.9 support in favor of 3.12 and 3.13 #241

Merged
merged 13 commits into from
Dec 3, 2024
Merged

Conversation

thalassemia
Copy link
Contributor

@thalassemia thalassemia commented Dec 2, 2024

I was able to update requirements.txt to work on Python 3.10-3.13. Unfortunately, the latest possible version of networkx that installs on Python 3.9 is 3.2.1, and a change in networkx 3.4 breaks our plot_topology function. I could add logic to determine the version of networkx and do different things depending on whether it is greater or less than 3.4, but that sounds unnecessarily complicated. Instead, I think it makes more sense to just bump the required Python version to 3.10 and networkx version to 3.4. For context, Python 3.9 reaches end-of-life in 2025-10, and big packages like Numpy and Scipy have already dropped support for it.

Other changes include:


By creating this pull request, I agree to the Contributor License
Agreement, which is available in CLA.md at the top level of this
repository.

Otherwise fails with TypeError: '<' not supported between instances of 'Path' and 'Path'
@thalassemia thalassemia requested a review from a team as a code owner December 2, 2024 02:22
@thalassemia thalassemia force-pushed the python-3.12 branch 5 times, most recently from 8ff8285 to 188e0c0 Compare December 2, 2024 06:03
@thalassemia thalassemia force-pushed the python-3.12 branch 2 times, most recently from ec91724 to 8f81129 Compare December 2, 2024 06:58
@thalassemia thalassemia changed the title Drop Python 3.9 support in favor of 3.12 Drop Python 3.9 support in favor of 3.12 and 3.13 Dec 2, 2024
Comment on lines +720 to +729
# Linux's default ``fork`` start method causes a lot of random
# issues, including python/cpython#110770 (prompted this change)
# and python/cpython#84559 (general discussion). This default
# will be changed to ``forkserver`` in Python 3.14. MacOS and
# Windows use the much safer but slightly slower ``spawn`` method
if sys.platform not in ("darwin", "win32"):
start_method = "forkserver"
else:
start_method = "spawn"
mp_ctx = multiprocessing.get_context(start_method)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

Copy link
Member

@eagmon eagmon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @thalassemia! So is there topology graphing as it currently stands?

nbconvert==7.16.4
nbformat==5.10.4
nbsphinx==0.9.5
networkx==3.4.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so this is compatible with 3.10+ but not 3.9?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the current latest versions of all requirements that work on 3.10-3.13. The problem with 3.9 is that you can't install networkx 3.4+, which requires a change in plot_topology to work (included in this PR).

@thalassemia
Copy link
Contributor Author

Thanks @thalassemia! So is there topology graphing as it currently stands?

plot_topology works in the current release as long as you have networkx<3.4. I think those older versions of networkx should work on Python 3.10-3.13 as well. I don't think it is a good idea to cap the networkx version to address the issue with networkx 3.4+.

@eagmon
Copy link
Member

eagmon commented Dec 3, 2024

@thalassemia -- looks like there are still some 3.9-related tests hanging. Can you remove these from the GitHub actions?

@thalassemia
Copy link
Contributor Author

I think those are required by some repository setting that I can't access. Instead of hanging they're just not being run. These docs might be helpful.

@eagmon eagmon merged commit 60b1570 into master Dec 3, 2024
16 checks passed
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.

Nested profiling with cProfile raises exception in Python 3.12.
2 participants