Characterizing and detecting Python version incompatibilities caused by inconsistent version specifications

Python interpreter serves as the foundation for developing Python projects. Configuring compatible Python version is essential for packaging and reusing third-party libraries (TPLs) in the Python ecosystem. When the Python distribution version range constraint of a third-party library is incorrectly...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:The Journal of systems and software Jg. 222; S. 112337
Hauptverfasser: Li, Shuo, Gao, Haocheng, Chen, Wei, Li, Yi, Tian, Haoxiang, Liu, Chengwei, Ye, Dan
Format: Journal Article
Sprache:Englisch
Veröffentlicht: Elsevier Inc 01.04.2025
Schlagworte:
ISSN:0164-1212
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:Python interpreter serves as the foundation for developing Python projects. Configuring compatible Python version is essential for packaging and reusing third-party libraries (TPLs) in the Python ecosystem. When the Python distribution version range constraint of a third-party library is incorrectly declared, it may lead to installation failures or runtime errors when the library is used by a client project. We call such errors Python Distribution Version Specification Error (PDSpecErr). PDSpecErrs are not studied adequately and there still lacks a method to guarantee the correctness of Python version specifications. To combat PDSpecErrs and mitigate their adverse impacts on downstream applications, we conducted the first exploratory study on 3000 real-world TPLs to investigate PDSpecErrs about their prevalence, symptom categories, and diagnostic patterns. Based on the comprehensive study, we designed and implemented PyChecker, a tool to automatically detect PDSpecErrs in TPLs, locate root causes, and generate fixing solutions. We evaluated PyChecker on 3000 TPL releases and PyChecker detected 842 PDSpecErrs, reporting their root causes and recommending fixing solutions. We have reported 52 PDSpecErrs to the concerned developers. So far, 32 issues have been confirmed and fixed according to our suggestions. •We conducted the first study on Python distribution version errors in top 3,000 TPLs.•Around 10% of TPLs had errors, causing installation failures and runtime issues.•We developed PyChecker to detect errors, find root causes, and suggest fixes.•PyChecker found 842 TPLs with errors; 61.5% of reported cases were fixed.•We provide PyChecker and evaluation data for replication and further research.
ISSN:0164-1212
DOI:10.1016/j.jss.2025.112337