-
Notifications
You must be signed in to change notification settings - Fork 229
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
Python version update #309
base: dev
Are you sure you want to change the base?
Conversation
This happened to be a regression for WireViz-Web [1], which aims to do as much in memory as possible. [1] https://github.com/daq-tools/wireviz-web.
The two header comments were missing an endline. Closes wireviz#258
I'm sorry this PR hasn't got any attention since @MNiedzielski marked it ready for review several months ago. Please compare these suggested workflows and setup changes against some similar changes included in PR #251 (that also contains a huge amount of other changes). They are not equal, and I wonder if anyone can describe some advantages and disadvantages between the different choices.
|
Hi there, first of all, thank you for your contribution, Mark. As @kvid outlined, GH-251 will bring in a few modernizations in this regard already. I think we should merge that one first, and then see what's left.
https://devguide.python.org/versions/ has a good orientation what to support in general. When there are other obstacles, regarding dependencies or such, with corresponding reasons to drop support for older Python versions earlier, before their official EOL date, so be it.
Version numbers like With kind regards, |
Would it make sense to only support the current Python version (3.12 as of now), at least officially? A note in the Readme could state that "WireViz requires Python 3.12. It may or may not work on other versions". This would speed up the build process by only running it once with the proper version instead of five times (or two, as it is now), as well as keeping local development simple, without having to have all versions installed, and potentially keeping the code clean by not having to support legacy syntax (e.g. type hint syntax added in Python 3.10). |
@formatc1702 wrote:
If we should support more than one Python version, I would look to common distributions, e.g. for Ubuntu:
See an updated list here: https://packages.ubuntu.com/search?keywords=python3&searchon=names&exact=1&suite=all§ion=all
I agree we should limit the number of tested Python versions, and five is probably too many. However, I would consider supporting both 3.10 and 3.12 (personally, I would also like to still use 3.8 because I currently use that for other on-going projects, but I realize it'll reach end-of-life within half a year). Is it realistic to agree on something about this to be included in #339 as the current Python versions listed in Edit: On the other hand, if we test in the workflow only the oldest supported Python version (e.g. 3.8), shouldn't we then expect it to also work in all later minor versions due to backward compatibility (except for effects from bug-fixes, etc.), or have I misunderstood something? |
I have been using Ubuntu jammy (22.04 LTS) with no problem. I would stress full support for one version (3.8 or 3.7) and stretch to test 3.10 or 3.12. I have spun up many VM in virtual box and had no problem (that I noticed so far). |
Perhaps if we specify compatibility with versions 3.8 to 3.12, checking new PRs/commits against 3.8 and 3.12 could be enough. For merges into master, it might make sense to enforce stricter checking for all intermediate versions as well to prevent any public blunders. If it's possible to somehow edit the GitHub workflow config for this, I'm more than happy to integrate it. |
Heh. Sorry, I don't mean to laugh, but Python does not provide backwards compatibility between minor versions. They can, will, and do remove previously-deprecated features, which will often break things hard. A partial sampling of breakage in recent minor Python releases: Removed in Python 3.12distutilsRemove the distutils package. It was deprecated in Python 3.10 by PEP 632 “Deprecate distutils module”. For projects still using distutils and cannot be updated to something else, the setuptools project can be installed: it still provides distutils. (Contributed by Victor Stinner in gh-92584.) importlibMany previously deprecated cleanups in importlib have now been completed: References to, and support for module_repr() has been removed. (Contributed by Barry Warsaw in gh-97850.) importlib.util.set_package, importlib.util.set_loader and importlib.util.module_for_loader have all been removed. (Contributed by Brett Cannon and Nikita Sobolev in gh-65961 and gh-97850.) Support for find_loader() and find_module() APIs have been removed. (Contributed by Barry Warsaw in gh-98040.) importlib.abc.Finder, pkgutil.ImpImporter, and pkgutil.ImpLoader have been removed. (Contributed by Barry Warsaw in gh-98040.) impThe imp module has been removed. (Contributed by Barry Warsaw in gh-98040.) ioRemove io’s io.OpenWrapper and _pyio.OpenWrapper, deprecated in Python 3.10: just use open() instead. The open() (io.open()) function is a built-in function. Since Python 3.10, _pyio.open() is also a static method. (Contributed by Victor Stinner in gh-94169.) localeRemove locale’s locale.format() function, deprecated in Python 3.7: use locale.format_string() instead. (Contributed by Victor Stinner in gh-94226.) Others
Removed in Python 3.11
Removed in Python 3.10
Removed in Python 3.9
|
I'm not sure if that makes sense, because every PR is ultimately a(n eventual) prospective merge into Plus, if every merge into |
That being said, running The only warnings that pop up are the fact that none of the files being opened by |
@ferdnyc - Thank's a lot for filling a bit of the huge white spaces in my Python knowledge! 😃
|
A number of warnings showed up when running e.g. PYTHONWARNINGS=always python build_examples.py See #309 (comment) Fix: All open() calls should be in a "with open() as x" statement to ensure closing the file when exiting the block in any way. Otherwise, use the new file_read_text() or file_write_text() to read or write the whole utf-8 text file and closing it.
A number of such warnings showed up when running e.g. PYTHONWARNINGS=always python build_examples.py PYTHONWARNINGS=always wireviz ../../examples/demo0?.yml See #309 (comment) Fix: All open() calls should be in a "with open() as x" statement to ensure closing the file when exiting the block in any way. Otherwise, use the new file_read_text() or file_write_text() functions to read or write the whole utf-8 text file and closing it.
A number of such warnings showed up when running e.g. PYTHONWARNINGS=always python build_examples.py PYTHONWARNINGS=always wireviz ../../examples/demo0?.yml See #309 (comment) Fix: All open() calls should be in a "with open() as x" statement to ensure closing the file when exiting the block in any way. Otherwise, use the new file_read_text() or file_write_text() functions to read or write the whole utf-8 text file and closing it.
A number of such warnings showed up when running e.g. PYTHONWARNINGS=always python build_examples.py PYTHONWARNINGS=always wireviz ../../examples/demo0?.yml See #309 (comment) Fix: All open() calls should be in a "with open() as x" statement to ensure closing the file when exiting the block in any way. Otherwise, use the new file_read_text() or file_write_text() functions to read or write the whole utf-8 text file and closing it.
Running 6 different Python versions (3.7 to 3.12) in parallel now. NOTE: This is in conflict with #309, but can be resolved easily in a later PR. GitHub Actions require an update: - actions/upload-artifact@v3 is scheduled for deprecation on November 30, 2024. - Similarly, v1/v2 are scheduled for deprecation on June 30, 2024. - Updating this comes with a breaking change in upload-artifact@v4: Uploading to the same named Artifact multiple times. Due to how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple Artifacts with different names, or only upload once. Otherwise you will encounter an error. The artifact .zip files therefore have the python version added to their name.
Running 6 different Python versions (3.7 to 3.12) in parallel now. NOTE: This is in conflict with wireviz#309, but can be resolved easily in a later PR. GitHub Actions require an update: - actions/upload-artifact@v3 is scheduled for deprecation on November 30, 2024. - Similarly, v1/v2 are scheduled for deprecation on June 30, 2024. - Updating this comes with a breaking change in upload-artifact@v4: Uploading to the same named Artifact multiple times. Due to how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple Artifacts with different names, or only upload once. Otherwise you will encounter an error. The artifact .zip files therefore have the python version added to their name.
Enable tests for current Python versions.