snakeoil icon indicating copy to clipboard operation
snakeoil copied to clipboard

Remove distutils_extensions.py

Open arthurzam opened this issue 3 years ago • 5 comments

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, ...)

arthurzam avatar Aug 24 '22 10:08 arthurzam

I think flit would work if you made tree-sitter-bash built-on-import.

mgorny avatar Aug 24 '22 10:08 mgorny

@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 flit would 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

arthurzam avatar Aug 27 '22 13:08 arthurzam

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.

mgorny avatar Aug 27 '22 18:08 mgorny

Update on progress:

  1. 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
  2. snakeoil is using pure flit
  3. pkgcore is already using flit with custom wrapper to handle some extra file generation. This approach will be needed for other parts of stack.
  4. pkgdev is ready to be moved to flit after new release of snakeoil with sphinx extension is done. It was a simple one without issues.
  5. pkgcheck will 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:

  1. Use flit, and wrap after wheel generation, to rename the wheel, and open it's insides to edit WHEEL file and replace the tag with Tag: py3-none-any.
  2. 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?

arthurzam avatar Nov 11 '22 19:11 arthurzam

I think the latter (i.e. setuptools) would be better.

mgorny avatar Nov 12 '22 08:11 mgorny

Update: the module is unused and was marked as deprecated. I think in some releases it will be removed finally.

arthurzam avatar Dec 09 '22 14:12 arthurzam