ydiff icon indicating copy to clipboard operation
ydiff copied to clipboard

Replace legacy distutils by... setuptools?

Open hartwork opened this issue 3 years ago • 2 comments

Hi @ymattw,

are there any plans to migrate off legacy distutils? There are multiple options for a target, what are your thoughts and/or equirements for a pull request with a good chance of getting merged if any?

Best, Sebastian

hartwork avatar Nov 28 '22 22:11 hartwork

Confirmed that this breaks ydiff for Fedora 39; that link should contain some useful links about how to get rid of distutils

https://bugzilla.redhat.com/show_bug.cgi?id=2154966

AloisMahdal avatar Dec 22 '22 11:12 AloisMahdal

@AloisMahdal good to know!

@ymattw any thoughts?

hartwork avatar Dec 22 '22 12:12 hartwork

While I am annoyed by such kind of breakage introduced in new python versions, this problem is not an issue (yet) to ydiff itself. To create a release package, one can use python environments that still have the distutils installed - from python<3.12 built-in or via third party tool.

Yes the solution would be moving to setuptools, I suppose it's builtin in major python 3 versions. But I have to find another time when I am in the mood of fixing everything related to releases all together (GitHub action for package test, docker image, documentation, etc.).

ymattw avatar Jun 21 '24 18:06 ymattw

Interestingly, distutils still works in at least up to 3.12.4?

⮕ % docker run -it -v $(pwd):$(pwd) python:3.12.4-alpine sh
/ # apk add --no-cache bash make
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
(1/2) Installing bash (5.2.26-r0)
Executing bash-5.2.26-r0.post-install
(2/2) Installing make (4.4.1-r2)
Executing busybox-1.36.1-r29.trigger
OK: 17 MiB in 39 packages
/ # cd /home/ymattw/ydiff/
/home/ymattw/ydiff # make build
./setup.py build sdist
/home/ymattw/ydiff #

ymattw avatar Jun 21 '24 19:06 ymattw

@ymattw I would need to double check to be sure why that is, either it's distro patches or setuptools being installed and being the indirect provider of distutils, something like that.

Would you acctep a pull request migrating from distutils to setuptools? It would solve the problem, and the only work on your shoulders is review then. What do you think?

hartwork avatar Jun 22 '24 10:06 hartwork

Sure, pull request is always welcome, please make sure https://github.com/ymattw/ydiff/actions/workflows/package.yml passes.

ymattw avatar Jun 22 '24 12:06 ymattw

@ymattw done, please see #119.

hartwork avatar Jun 22 '24 16:06 hartwork