nightlark / swig-pypi

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

Swig-PyPI installation on IBM I Power System #102

Closed vint7k closed 11 months ago

vint7k commented 11 months ago

We have IBMi OS V7R3, with Python 3.9 installed.

We are trying to install swig-PyPI in the virtual environment. This package is needed to install PyMuPDF package.

Now when we are trying pip install swig-PyPI , it is stuck while looking for dynamic metadata. As far as I am aware as per pep621, the way build happens has changed i.e. using pyproject.toml file. The error log is below what we are facing.


          The following seems to be defined outside of pyproject.toml:             license = '[https://github.com/swig/swig/blob/master/LICENSE'](https://github.com/swig/swig/blob/master/LICENSE%2527%60)             According to the spec (see the link below), however, setuptools CANNOT           consider this value unless license is listed as dynamic.             https://packaging.python.org/en/latest/specifications/declaring-project-metadata/             To prevent this problem, you can list license under dynamic or alternatively           remove the [project] table from your file and rely entirely on other means of           configuration.           ****     !!     _handle_missing_dynamic(dist, project_table)   /tmp/pip-build-env-_bhck8rn/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:75: _MissingDynamic: urls defined outside of pyproject.toml is ignored.   !!             ****           The following seems to be defined outside of pyproject.toml:             urls = {'Source Code': '[https://github.com/nightlark/swig-pypi'](https://github.com/nightlark/swig-pypi%27), 'Bug Tracker': '[https://github.com/nightlark/swig-pypi/issues'}](https://github.com/nightlark/swig-pypi/issues%2527%257D%60)             According to the spec (see the link below), however, setuptools CANNOT           consider this value unless urls is listed as dynamic.             https://packaging.python.org/en/latest/specifications/declaring-project-metadata/             To prevent this problem, you can list urls under dynamic or alternatively           remove the [project] table from your file and rely entirely on other means of           configuration.           ****

have anyone faced this issue ? We have latest version of pip and setuptools

nightlark commented 11 months ago

That's interesting, I haven't heard anyone having this issue before, but most users are likely able to install from a pre-built binary wheel -- ~what versions of pip and setuptools are you using?~ (just noticed you said latest versions).

Out of curiosity, which processor is your system using? (POWER8, POWER9, etc)

I would like to get as many of the remaining arguments in the setup function call in setup.py moved over to pyproject.toml, so once that happens hopefully this issue will be resolved.

vint7k commented 11 months ago

Yes, I tried the installation on other RHEL system. It works fine. This is on Power7 processor running IBMi V7R3 OS. Below are the setuptools, pip and wheel version installed: pip 23.3.1 setuptools 69.0.2 wheel 0.41.3 Even we tried using the ppce64 whl files from pypi repository i.e [swig-4.1.1.post0-py2.py3-none-musllinux_1_1_ppc64le.whl ] and swig-4.1.1.post0-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl , but it errors out saying not compatible with this OS platform.

Looking for ways to have it installed.

====Error log during the PyMuPDF installation======== (qrvenv) $ CFLAGS=-D_LINUX_SOURCE_COMPAT pip3 --verbose install PyMuPDF Using pip 23.3.1 from /home/sysdba/pyqrcode/qrvenv/lib/python3.9/site-packages/pip (python 3.9) Collecting PyMuPDF Using cached PyMuPDF-1.23.6.tar.gz (77.7 MB) Running command pip subprocess to install build dependencies Using pip 23.3.1 from /home/sysdba/pyqrcode/qrvenv/lib/python3.9/site-packages/pip (python 3.9) Collecting libclang Using cached libclang-16.0.6-py2.py3-none-any.whl Collecting swig Using cached swig-4.1.1.post0.tar.gz (26 kB) Installing build dependencies: started Running command pip subprocess to install build dependencies Using pip 23.3.1 from /home/sysdba/pyqrcode/qrvenv/lib/python3.9/site-packages/pip (python 3.9) Collecting setuptools>=64 Obtaining dependency information for setuptools>=64 from https://files.pythonhosted.org/packages/bb/e1/ed2dd0850446b8697ad28d118df885ad04140c64ace06c4bd559f7c8a94f/setuptools-69.0.2-py3-none-any.whl.metadata Using cached setuptools-69.0.2-py3-none-any.whl.metadata (6.3 kB) Collecting wheel Obtaining dependency information for wheel from https://files.pythonhosted.org/packages/c7/c3/55076fc728723ef927521abaa1955213d094933dc36d4a2008d5101e1af5/wheel-0.42.0-py3-none-any.whl.metadata Using cached wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB) Collecting scikit-build Obtaining dependency information for scikit-build from https://files.pythonhosted.org/packages/fa/af/b3ef8fe0bb96bf7308e1f9d196fc069f0c75d9c74cfaad851e418cc704f4/scikit_build-0.17.6-py3-none-any.whl.metadata Using cached scikit_build-0.17.6-py3-none-any.whl.metadata (14 kB) Collecting setuptools_scm>=8 Obtaining dependency information for setuptools_scm>=8 from https://files.pythonhosted.org/packages/0e/a3/b9a8b0adfe672bf0df5901707aa929d30a97ee390ba651910186776746d2/setuptools_scm-8.0.4-py3-none-any.whl.metadata Using cached setuptools_scm-8.0.4-py3-none-any.whl.metadata (6.4 kB) Collecting distro (from scikit-build) Using cached distro-1.8.0-py3-none-any.whl (20 kB) Collecting packaging (from scikit-build) Obtaining dependency information for packaging from https://files.pythonhosted.org/packages/ec/1a/610693ac4ee14fcdf2d9bf3c493370e4f2ef7ae2e19217d7a237ff42367d/packaging-23.2-py3-none-any.whl.metadata Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB) Collecting tomli (from scikit-build) Using cached tomli-2.0.1-py3-none-any.whl (12 kB) Collecting typing-extensions (from setuptools_scm>=8) Obtaining dependency information for typing-extensions from https://files.pythonhosted.org/packages/24/21/7d397a4b7934ff4028987914ac1044d3b7d52712f30e2ac7a2ae5bc86dd0/typing_extensions-4.8.0-py3-none-any.whl.metadata Using cached typing_extensions-4.8.0-py3-none-any.whl.metadata (3.0 kB) Using cached setuptools-69.0.2-py3-none-any.whl (819 kB) Using cached wheel-0.42.0-py3-none-any.whl (65 kB) Using cached scikit_build-0.17.6-py3-none-any.whl (84 kB) Using cached setuptools_scm-8.0.4-py3-none-any.whl (42 kB) Using cached packaging-23.2-py3-none-any.whl (53 kB) Using cached typing_extensions-4.8.0-py3-none-any.whl (31 kB) Installing collected packages: wheel, typing-extensions, tomli, setuptools, packaging, distro, setuptools_scm, scikit-build Creating /tmp/pip-build-env-5eg7a0gx/overlay/bin changing mode of /tmp/pip-build-env-5eg7a0gx/overlay/bin/wheel to 755 changing mode of /tmp/pip-build-env-5eg7a0gx/overlay/bin/distro to 755 Successfully installed distro-1.8.0 packaging-23.2 scikit-build-0.17.6 setuptools-69.0.2 setuptools_scm-8.0.4 tomli-2.0.1 typing-extensions-4.8.0 wheel-0.42.0 Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Running command Getting requirements to build wheel /tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools_scm/git.py:308: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools_scm/git.py:327: UserWarning: unprocessed git archival found (no export subst applied) warnings.warn("unprocessed git archival found (no export subst applied)") /tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:75: _MissingDynamic: license defined outside of pyproject.toml is ignored. !!

        ********************************************************************************
        The following seems to be defined outside of `pyproject.toml`:

        `license = '[https://github.com/swig/swig/blob/master/LICENSE'`](https://github.com/swig/swig/blob/master/LICENSE%27%60)

        According to the spec (see the link below), however, setuptools CANNOT
        consider this value unless `license` is listed as `dynamic`.

        https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

        To prevent this problem, you can list `license` under `dynamic` or alternatively
        remove the `[project]` table from your file and rely entirely on other means of
        configuration.
        ********************************************************************************

!!
  _handle_missing_dynamic(dist, project_table)
/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:75: _MissingDynamic: `urls` defined outside of `pyproject.toml` is ignored.
!!

        ********************************************************************************
        The following seems to be defined outside of `pyproject.toml`:

        `urls = {'Source Code': '[https://github.com/nightlark/swig-pypi'](https://github.com/nightlark/swig-pypi%27), 'Bug Tracker': '[https://github.com/nightlark/swig-pypi/issues'}`](https://github.com/nightlark/swig-pypi/issues%27%7D%60)

        According to the spec (see the link below), however, setuptools CANNOT
        consider this value unless `urls` is listed as `dynamic`.

        https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

        To prevent this problem, you can list `urls` under `dynamic` or alternatively
        remove the `[project]` table from your file and rely entirely on other means of
        configuration.
        ********************************************************************************

!!
  _handle_missing_dynamic(dist, project_table)
Traceback (most recent call last):
  File "/home/sysdba/pyqrcode/qrvenv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/home/sysdba/pyqrcode/qrvenv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/home/sysdba/pyqrcode/qrvenv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
    self.run_setup()
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 21, in <module>
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 488, in setup
    ) = _parse_setuptools_arguments(kw)
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 221, in _parse_setuptools_arguments
    dist.parse_config_files()
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 627, in parse_config_files
    pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py", line 67, in apply_configuration
    return _apply(dist, config, filepath)
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 56, in apply
    _apply_project_table(dist, config, root_dir)
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 82, in _apply_project_table
    corresp(dist, value, root_dir)
  File "/tmp/pip-build-env-5eg7a0gx/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 183, in _license
    _set_config(dist, "license", val["text"])
KeyError: 'text'
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/sysdba/pyqrcode/qrvenv/bin/python3.9 /home/sysdba/pyqrcode/qrvenv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpf36movv_
cwd: /tmp/pip-install-rhi8wov9/swig_573046361007439dad450a822b8da8a4
Getting requirements to build wheel: finished with status 'error'

error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. full command: /home/sysdba/pyqrcode/qrvenv/bin/python3.9 /home/sysdba/pyqrcode/qrvenv/lib/python3.9/site-packages/pip/pip-runner.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-asgb7hta/overlay --no-warn-script-location -v --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- libclang swig setuptools cwd: [inherit] Installing build dependencies ... error error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

cjkpl commented 11 months ago

I confirm this error - exactly the same issue, with the same error messages on FreeBSD.

vint7k commented 11 months ago

Noted @cjkpl. Could you please let me know ways to fix this issue? We are stuck and couldn't have it installed.

nightlark commented 11 months ago

Interesting -- the CI builds are failing with the same error, so I'm able to reproduce the bug easily. I think the new setuptools v69 release about 2 weeks ago made it more strict about metadata fields either being specified in pyproject.toml, or specifically telling setuptools that the field is dynamic due to being set in setup.py.

The solution I'm leaning towards is move all the metadata from setup.py to pyproject.toml -- hopefully will be able to get a new release out that fixes this issue after work (~10 hours).

nightlark commented 11 months ago

@cjkpl @vint7k I just published a new 4.1.1.post1 release that should make it work again with the latest setuptools. Let me know if you're still getting errors.

vint7k commented 11 months ago

Will have to try the installation and then can confirm. Thanks @nightlark. I will keep you updated.

cjkpl commented 11 months ago

@vint7k Thank you! Works like a charm :-)

nightlark commented 11 months ago

Great -- I'll close this issue since it sounds like the problem has been resolved. If not, leave a comment and I'll reopen it.