Remove distutils_extensions.py
For snakeoil v10, I want to fully remove distutils_extensions.py, and just use some plain build back-end.
Ideally I want to use flit, but I guess it is impossible to use for pkgcheck (as we need to build tree-sitter-bash there).
There will be also need for some "main command executor", but I think a plain Makefile will be good enough (pytest, pylint, sphinx man, sphinx html, install, wheel, sdist, ...)
I think flit would work if you made tree-sitter-bash built-on-import.
@mgorny Thanks for the input and encouragement. I will start the work across the stack, and when it looks good will call you for review 😄
I think
flitwould work if you made tree-sitter-bash built-on-import.
Can you please give some more info about this idea, or an example package that does that? Or maybe I misunderstood a lot and it is already implemented at the logic here?
https://github.com/pkgcore/pkgcheck/blob/f62212223635d8160dd848f96158a9d80d532715/src/pkgcheck/bash/init.py#L22-L87
Yes, that's the logic. I haven't tested that but I think it'd work if you called build_library from pkgcore/__init__.py — i.e. when flit_core imported it to get the version, it'd build the library.
Update on progress:
- as part of removal of this module, I needed to extract and cleanup the docs generation process, so I developed small sphinx extension to handle all the weird code https://github.com/pkgcore/snakeoil/pull/89
-
snakeoilis using pureflit -
pkgcoreis already usingflitwith custom wrapper to handle some extra file generation. This approach will be needed for other parts of stack. -
pkgdevis ready to be moved toflitafter new release of snakeoil with sphinx extension is done. It was a simple one without issues. -
pkgcheckwill need some extra work!
pkgcheck migration
pkgcheck bundles in the wheel libtree-sitter-bash.so, which is dependent on CPU arch + libc (so not universal) but doesn't link or use python libs, so it can be agnostic to python version.
flit only support universal wheels (it hard codes py3-none-any.whl). So I have 2 options:
- Use
flit, and wrap after wheel generation, to rename the wheel, and open it's insides to editWHEELfile and replace the tag withTag: py3-none-any. - Use simple setuptools (in the most simple way), so it creates for me the arch dependent wheel.
I hope for some more input on this, which is preferable?
I think the latter (i.e. setuptools) would be better.
Update: the module is unused and was marked as deprecated. I think in some releases it will be removed finally.