nightlark / swig-pypi

pip install swig. SWIG Python wheel for PyPI.
Apache License 2.0
12 stars 4 forks source link

feat: move to scikit-build-core #126

Closed henryiii closed 3 months ago

henryiii commented 6 months ago

Close #104.

I didn't include these files in the existing wheel:

./swig-4.2.1.data/data/LICENSE-SWIG
./swig-4.2.1.data/data/CMakeLists.txt
./swig-4.2.1.data/data/LICENSE-UNIVERSITIES
./swig-4.2.1.data/data/README.md
./swig-4.2.1.data/data/LICENSE-GPL

as the licenses are already in the correct place in the diet-info folder, people don't need the CMakeLists.txt or README.md, and these get installed to the root of the environment! For a virtualenv, that's bad:

$ uv venv
$ uv pip install swig
$ ls .venv
CACHEDIR.TAG          LICENSE-GPL           LICENSE-UNIVERSITIES  bin/                  pyvenv.cfg
CMakeLists.txt        LICENSE-SWIG          README.md             lib

And for a global install, that's horrible:

$ docker run --rm -it python:3.12 bash
# pip install swig
# ls /usr/local
CMakeLists.txt  LICENSE-GPL  LICENSE-SWIG  LICENSE-UNIVERSITIES  README.md  bin  etc  games  include  lib  man  sbin  share  src

The second commit uses a single macOS universal wheel with ARM and Intel tags also included. I could remove that if you'd prefer multiple smaller wheels. As it is, pip will never download the universal wheel, since it will get the most specific one.

nightlark commented 6 months ago

Thank you!! 😃

henryiii commented 6 months ago

Do you really want to support manylinux1? It's been abandoned by most projects & is years past EoL. The oldest cmake we still ship is 2010 (and highly recommend 2014). I can require binaries and see what the newest cmake to support manylinux1 was.

henryiii commented 6 months ago

Hopefully I remembered how to do that. :)

henryiii commented 6 months ago

FYI, the last cmake we shipped for manylinux1 was 3.22.6.

$ PIP_ONLY_BINARY=:all: docker run -e PIP_ONLY_BINARY --rm quay.io/pypa/manylinux1_x86_64 pipx run cmake --version
...
cmake version 3.22.6
...
nightlark commented 6 months ago

For supporting manylinux1 it's mostly been if the builds work with minimal hassle, might as well keep building them for users that haven't been able to update their Python/OS yet -- not sure if I'm reading it right, but from https://mayeut.github.io/manylinux-timeline/ it looks like there's maybe 3-5% of users with Python <=3.7 that only support manylinux1.