rfe: Deprecate distutils module - #3920
Conversation
0147dca to
dc787e0
Compare
|
https://github.com/avocado-framework/avocado-vt/blob/master/virttest/shared/scripts/virtio_console_guest.py |
fb14fb0 to
1cafcb4
Compare
|
Hello @clebergnu @luckyh, please help to review and raise your concerns. Another one is I noticed setup.py would also be deprecated, do we plan to migrate to the modern pyproject.toml? https://packaging.python.org/en/latest/guides/modernize-setup-py-project/#modernize-setup-py-project Besides pyproject.toml, I tried using |
luckyh
left a comment
There was a problem hiding this comment.
Hi @PaulYuuu , thanks for raising this up! I think the overall idea is good, however, I also have the following concerns.
1cafcb4 to
89e2a62
Compare
|
Hi @PaulYuuu, have you considered moving the setup.py entirely to a pyproject.toml file as described in PEP 621? Perhaps this could make things simpler? Other than that what is the current status of this pull request? I guess it was converted to a draft since it is not considered to be the way forward or has a big roadblock ahead of it? |
Good question! The answer is yes, please refer to #3924 However, avocado still uses setup.py, so for avocado-vt, I am not sure if avocado-vt can go one step ahead. And this is a big milestone; it may break something, and it needs all maintainers to identify the risk. |
|
Hmmm I see, the difference is that Avocado already added Python 3.12 and 3.13 support while the setup procedures in VT are still outdated. So I assume we are not sure if it is worth investing the time to merge this and deal with any breakage until Avocado makes the pyproject.toml step which could save us effort? |
I have no idea. Let me cc other maintainers here for the discussion. @luckyh @richtja @clebergnu @YongxueHong @chunfuwen |
|
Hi @PaulYuuu and @pevogam, in avocado we plan to move from distils avocado-framework/avocado#5159 and migrate to pyproject.toml avocado-framework/avocado#5754. Unfortunately, we don't have anyone who would be working on that, so we hare postponing it. For now, we have solved this by adding settuptools as avocado dependency to support python3.12 and 3.13 avocado-framework/avocado#5789 |
117a594 to
9691c3c
Compare
|
The PR is ready for review. Let me clarify some concerns regarding the above comments.
>>> from packaging.version import parse
>>> from distutils.version import LooseVersion
>>> version_packaging = parse("1.0.0-1")
>>> version_distutils = LooseVersion("1.0.0-1")
<stdin>:1: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
>>> version_packaging
<Version('1.0.0.post1')>
>>> version_distutils
LooseVersion ('1.0.0-1')
>>> version_packaging.base_version
'1.0.0'
>>> version_distutils.version
[1, 0, 0, '-', 1] |
|
Hello @richtja, I have a question: Will we still maintain the Cirrus CI? I saw that most of the quay images are quite old, like Fedora-35 and Centos-8.1, which causes some CI jobs to fail. |
Hi @PaulYuuu AFAIK we removed Cirrus CI from avocado CI in avocado-framework/avocado#5239, but I don't know why it has been kept in avocado-vt, maybe @clebergnu will have more details. IMO there is no need to keep Cirrus CI, and we could migrate to GitHub Actions. About the quay images I know that on avocado we maintain and use only the check-copr-rpm-version image. |
9691c3c to
e7427f5
Compare
|
Hey guys, is there any update here? If no, I can start by removing the centos_8_1 task from Cirrus CI since CentOS8 has been EOL for a long time. |
e7427f5 to
4255383
Compare
17ce6f0 to
2578f23
Compare
distutils will be formally marked as deprecated since python3.10, and will no longer work from python3.12. To enable python3.12 in avocado framework, this patch will replace distutils to use other modules. Signed-off-by: Yihuang Yu <yihyu@redhat.com>
The `setup.py clean` command is deprecated in modern Python packaging tools like Hatchling and setuptools ≥61. As the Python packaging ecosystem transitions away from `setup.py`, relying on it for cleanup introduces inconsistencies and future maintenance issues. Instead, the cleanup logic has been moved to the Makefile under the `make clean` target, which is more maintainable and aligns with modern Python project practices. This change helps simplify the build system and makes the project more future-proof. Signed-off-by: Yihuang Yu <yihyu@redhat.com>
2578f23 to
66cc9cc
Compare
richtja
left a comment
There was a problem hiding this comment.
Hi @PaulYuuu, thank you, I think we can learn from this and apply it to avocado as well. LGTM
|
Hi @pevogam, And after this gets merged, your PR #4101 may be can rebase and then continue to review. |
Sorry I took a while, will do this tomorrow right away |
|
Ok, I see no problem with these changes ✔️ |
|
Thank you all, I will merge this PR soon, let's see later if it will introduce any negative impact. If so, I will follow up on it. |
distutils will be formally marked as deprecated since python3.10, and will no longer work from python3.12. To enable python3.12 in avocado framework, this patch will replace distutils to use other modules.
ID: 2433
ref: https://peps.python.org/pep-0632