python / python/cpython

Add PEP 741 PyInitConfig API to the limited C API

Aberta
#149,163 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

interpreter-core topic-C-API
Linguagem predominante
Python
Estrelas
77.2k
Forks
35.9k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

The GDB project would be interested to use the limited C API to embed Python. Some APIs used by GDB are missing from the limited C API (well, it's limited ;-)), one of them is the PEP 741 PyInitConfig API.

I propose adding PEP 741 PyInitConfig API to the limited C API.

PEP 741 Rationale lists other projects embedding Python. More projects would benefit from PyInitConfig being in the limited C API.

For example, the vim text editor uses dlopen/dlsym and GetProcAddress on Windows to get Python symbols at runtime. The libpython library is loaded on demand (at the first Python usage). vim already supports the stable ABI. See src/if_python3.c.

So far, I found pyinstaller which already adopted the PyInitConfig API.

Linked PRs
  • gh-149194

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Leia a justificativa para embedding do PEP 741 e inspecione o src/if_python3.c do Vim para entender o caso de uso da limited ABI. Em seguida, revise o PR vinculado gh-149194 e o trabalho na limited C API; considera-se concluído quando PyInitConfig estiver disponível por meio dessa API para projetos que incorporam Python.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
c, python
Domínio
api, backend
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.