aleaxit / gmpy

General Multi-Precision arithmetic for Python 2.6+/3+ (GMP, MPIR, MPFR, MPC)
https://gmpy2.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
510 stars 86 forks source link

2.1.5: *.h and *.pxd files are installed #421

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

Looks like .h and .pxd files should be added to exclude list

+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
running egg_info
creating gmpy2.egg-info
writing gmpy2.egg-info/PKG-INFO
writing dependency_links to gmpy2.egg-info/dependency_links.txt
writing top-level names to gmpy2.egg-info/top_level.txt
writing manifest file 'gmpy2.egg-info/SOURCES.txt'
reading manifest file 'gmpy2.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'COPYING'
adding license file 'COPYING.LESSER'
writing manifest file 'gmpy2.egg-info/SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/gmpy2
copying gmpy2/__init__.py -> build/lib.linux-x86_64-cpython-38/gmpy2
running egg_info
writing gmpy2.egg-info/PKG-INFO
writing dependency_links to gmpy2.egg-info/dependency_links.txt
writing top-level names to gmpy2.egg-info/top_level.txt
reading manifest file 'gmpy2.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'COPYING'
adding license file 'COPYING.LESSER'
writing manifest file 'gmpy2.egg-info/SOURCES.txt'
copying gmpy2/__init__.pxd -> build/lib.linux-x86_64-cpython-38/gmpy2
copying gmpy2/gmpy2.h -> build/lib.linux-x86_64-cpython-38/gmpy2
copying gmpy2/gmpy2.pxd -> build/lib.linux-x86_64-cpython-38/gmpy2
running build_ext
building 'gmpy2.gmpy2' extension
creating build/temp.linux-x86_64-cpython-38
creating build/temp.linux-x86_64-cpython-38/src
/usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -I./src -I/usr/include/python3.8 -c src/gmpy2.c -o build/temp.linux-x86_64-cpython-38/src/gmpy2.o -DSHARED=1
/usr/bin/gcc -shared -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none build/temp.linux-x86_64-cpython-38/src/gmpy2.o -L/usr/lib64 -lmpc -lmpfr -lgmp -lm -o build/lib.linux-x86_64-cpython-38/gmpy2/gmpy2.cpython-38-x86_64-linux-gnu.so
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/gmpy2
copying build/lib.linux-x86_64-cpython-38/gmpy2/__init__.py -> build/bdist.linux-x86_64/wheel/gmpy2
copying build/lib.linux-x86_64-cpython-38/gmpy2/__init__.pxd -> build/bdist.linux-x86_64/wheel/gmpy2
copying build/lib.linux-x86_64-cpython-38/gmpy2/gmpy2.h -> build/bdist.linux-x86_64/wheel/gmpy2
copying build/lib.linux-x86_64-cpython-38/gmpy2/gmpy2.pxd -> build/bdist.linux-x86_64/wheel/gmpy2
copying build/lib.linux-x86_64-cpython-38/gmpy2/gmpy2.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/gmpy2
running install_egg_info
Copying gmpy2.egg-info to build/bdist.linux-x86_64/wheel/gmpy2-2.1.5-py3.8.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/gmpy2-2.1.5.dist-info/WHEEL
creating '/home/tkloczko/rpmbuild/BUILD/gmpy-gmpy2-2.1.5/dist/.tmp-ufkridaw/gmpy2-2.1.5-cp38-cp38-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'gmpy2/__init__.pxd'
adding 'gmpy2/__init__.py'
adding 'gmpy2/gmpy2.cpython-38-x86_64-linux-gnu.so'
adding 'gmpy2/gmpy2.h'                << HERE
adding 'gmpy2/gmpy2.pxd'            << HERE
adding 'gmpy2-2.1.5.dist-info/COPYING'
adding 'gmpy2-2.1.5.dist-info/COPYING.LESSER'
adding 'gmpy2-2.1.5.dist-info/METADATA'
adding 'gmpy2-2.1.5.dist-info/WHEEL'
adding 'gmpy2-2.1.5.dist-info/top_level.txt'
adding 'gmpy2-2.1.5.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built gmpy2-2.1.5-cp38-cp38-linux_x86_64.whl
skirpichev commented 1 year ago

Looks like .h and .pxd files should be added to exclude list

Why? This C API and Cython interfaces.

kloczek commented 1 year ago

Maybe I'm wrong but I don't think that python supports calls from one DSO module to another one .. 🤔 AFAIK .pxd files only defines public interface of the linked DSO. I've already packaged +50 modules which are using cython and none of those modules have been installing header files or .pxd

[tkloczko@Intimidator SPECS]$ grep 'BuildRequires:.*python3dist(cython)' python*spec -l
python-aiohttp.spec
python-asyncpg.spec
python-cftime.spec
python-clevercsv.spec
python-cpyparsing.spec
python-debugpy.spec
python-editdistance.spec
python-editdistance-s.spec
python-extension-helpers.spec
python-falcon.spec
python-fastavro.spec
python-frozenlist.spec
python-gevent.spec
python-gssapi.spec
python-hidapi.spec
python-htmlpyever.spec
python-hunter.spec
python-ipython.spec
python-logbook.spec
python-lupa.spec
python-lxml.spec
python-mesonpy.spec
python-mpi4py.spec
python-msgpack.spec
python-multidict.spec
python-numpy.spec
python-orderedset.spec
python-pandas.spec
python-pcapy.spec
python-pkcs11.spec
python-pydantic.spec
python-pyjson5.spec
python-pyproj.spec
python-pyyaml.spec
python-rapidfuzz.spec
python-rasterio.spec
python-reedsolo.spec
python-ruamel-yaml-clib.spec
python-scikit-build.spec
python-scipy.spec
python-shapely.spec
python-sphinx-automodapi.spec
python-sqlalchemy.spec
python-stack-data.spec
python-sympy.spec
python-twisted.spec
python-uvloop.spec
python-yarl.spec
python-zeroconf.spec
python-zmq.spec
skirpichev commented 1 year ago

+50 modules which are using cython

Using Cython or are used by other Cython module(s)? FYI: https://gmpy2.readthedocs.io/en/latest/cython.html

skirpichev commented 1 year ago

@casevh, probably you could close this.

casevh commented 1 year ago

Those file are not used to compile gmpy2 but are used by other extension modules written in Cython that rely on gmpy2.