Add structured version info for modules wrapping external libraries
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Feature or enhancement
Several modules wrap an external library, but expose its version inconsistently: only a string, only a plain tuple, only the runtime or only the build-time version, or under a private name. gh-117404 established a pattern for zlib, bz2, lzma and compression.zstd: a string and a named tuple for the version the module was built against (XXX_VERSION, XXX_VERSION_INFO), and the same pair for the library actually loaded (xxx_version, xxx_version_info).
Other modules (existing names, with their types):
sqlite3— runtime:sqlite_version(str),sqlite_version_info(plain tuple, computed in Python from the string). No build-time version.pyexpat— runtime:EXPAT_VERSION(str, e.g.'expat_2.8.4'),version_info(plain tuple). No build-time version.decimal— runtime:__libmpdec_version__(str). No tuple, no build-time version. Matters more now that only the system libmpdec is used.readline— build-time:_READLINE_VERSION(int,0x0803). Runtime:_READLINE_RUNTIME_VERSION(int),_READLINE_LIBRARY_VERSION(str). All private;backend(str) tells readline from libedit.dbm.gnu— build-time: private_GDBM_VERSION(plain tuple). No runtime version (gdbm_versionis not exposed).dbm.ndbm— onlylibrary(str, the implementation name). No version.ctypes— nothing about libffi.uuid— nothing about libuuid.ssl— runtime:OPENSSL_VERSION(str),OPENSSL_VERSION_INFO(plain 5-tuple),OPENSSL_VERSION_NUMBER(int). Build-time: only private_OPENSSL_API_VERSION(plain 5-tuple). The existing names conflict with the scheme above (uppercase names for the runtime version).curses— runtime:ncurses_version(named tuple). No string, no build-time version. It is fine to keep only the named tuple.tkinter— build-time:_tkinter.TCL_VERSION,TK_VERSION(str, onlymajor.minor, e.g.'8.6'), andtkinter.TclVersion,TkVersion(float,8.6, derived from them). The runtime version cannot be obtained at import time without creating a Tcl interpreter; it is available asTcl().eval('info patchlevel').
Not all items need to be changed, and not all libraries provide both the compile-time and the runtime version. Sub-issues are opened for those that do.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza leyendo gh-117404 y comparando su patrón de API de versiones para zlib, bz2, lzma y compression.zstd con el inventario de módulos de este issue. Revisa los sub-issues relevantes y determina qué módulos pueden exponer información de versión coherente en tiempo de compilación y en tiempo de ejecución; se considera terminado cuando cada módulo seleccionado tiene una interfaz pública acordada sin romper los nombres existentes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- backend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100