Python 3.11 package install fails

Bug #1996122 reported by Alexander Heger
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PyGPGME
New
Undecided
Unassigned

Bug Description

I am trying to install pygpgme on vanilla Python 3.11 compiled from source (on Fedora 36) but get a compiler error message. Attached below. Would you be able to offer any advice on how this may be fixed?

```
~>pip3 install pygpgme
Collecting pygpgme
  Using cached pygpgme-0.3.tar.gz (50 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pygpgme
  Building wheel for pygpgme (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [75 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/gpgme
      copying gpgme/editutil.py -> build/lib.linux-x86_64-cpython-311/gpgme
      copying gpgme/__init__.py -> build/lib.linux-x86_64-cpython-311/gpgme
      running build_ext
      building 'gpgme._gpgme' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/src
      gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/alex/Python/include/python3.11 -c src/gpgme.c -o build/temp.linux-x86_64-cpython-311/src/gpgme.o
      src/gpgme.c: In function ‘create_module’:
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:61:5: note: in expansion of macro ‘INIT_TYPE’
         61 | INIT_TYPE(PyGpgmeContext_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:62:5: note: in expansion of macro ‘INIT_TYPE’
         62 | INIT_TYPE(PyGpgmeKey_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:63:5: note: in expansion of macro ‘INIT_TYPE’
         63 | INIT_TYPE(PyGpgmeSubkey_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:64:5: note: in expansion of macro ‘INIT_TYPE’
         64 | INIT_TYPE(PyGpgmeUserId_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:65:5: note: in expansion of macro ‘INIT_TYPE’
         65 | INIT_TYPE(PyGpgmeKeySig_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:66:5: note: in expansion of macro ‘INIT_TYPE’
         66 | INIT_TYPE(PyGpgmeNewSignature_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:67:5: note: in expansion of macro ‘INIT_TYPE’
         67 | INIT_TYPE(PyGpgmeSignature_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:68:5: note: in expansion of macro ‘INIT_TYPE’
         68 | INIT_TYPE(PyGpgmeImportResult_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:69:5: note: in expansion of macro ‘INIT_TYPE’
         69 | INIT_TYPE(PyGpgmeGenkeyResult_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:70:5: note: in expansion of macro ‘INIT_TYPE’
         70 | INIT_TYPE(PyGpgmeKeyIter_Type);
            | ^~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pygpgme
  Running setup.py clean for pygpgme
Failed to build pygpgme
Installing collected packages: pygpgme
  Running setup.py install for pygpgme ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pygpgme did not run successfully.
  │ exit code: 1
  ╰─> [77 lines of output]
      running install
      /home/alex/Python/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/gpgme
      copying gpgme/editutil.py -> build/lib.linux-x86_64-cpython-311/gpgme
      copying gpgme/__init__.py -> build/lib.linux-x86_64-cpython-311/gpgme
      running build_ext
      building 'gpgme._gpgme' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/src
      gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/alex/Python/include/python3.11 -c src/gpgme.c -o build/temp.linux-x86_64-cpython-311/src/gpgme.o
      src/gpgme.c: In function ‘create_module’:
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:61:5: note: in expansion of macro ‘INIT_TYPE’
         61 | INIT_TYPE(PyGpgmeContext_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:62:5: note: in expansion of macro ‘INIT_TYPE’
         62 | INIT_TYPE(PyGpgmeKey_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:63:5: note: in expansion of macro ‘INIT_TYPE’
         63 | INIT_TYPE(PyGpgmeSubkey_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:64:5: note: in expansion of macro ‘INIT_TYPE’
         64 | INIT_TYPE(PyGpgmeUserId_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:65:5: note: in expansion of macro ‘INIT_TYPE’
         65 | INIT_TYPE(PyGpgmeKeySig_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:66:5: note: in expansion of macro ‘INIT_TYPE’
         66 | INIT_TYPE(PyGpgmeNewSignature_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:67:5: note: in expansion of macro ‘INIT_TYPE’
         67 | INIT_TYPE(PyGpgmeSignature_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:68:5: note: in expansion of macro ‘INIT_TYPE’
         68 | INIT_TYPE(PyGpgmeImportResult_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:69:5: note: in expansion of macro ‘INIT_TYPE’
         69 | INIT_TYPE(PyGpgmeGenkeyResult_Type);
            | ^~~~~~~~~
      src/gpgme.c:49:24: error: lvalue required as left operand of assignment
         49 | Py_TYPE(&type) = &PyType_Type; \
            | ^
      src/gpgme.c:70:5: note: in expansion of macro ‘INIT_TYPE’
         70 | INIT_TYPE(PyGpgmeKeyIter_Type);
            | ^~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

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

× Encountered error while trying to install package.
╰─> pygpgme

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
```

Tags: 3.11 python
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.