I am an add-on developer and recently I would like to use pygments to highlight code in Anki within my add-on. In principle I can copy the whole package folder together with my addon and use relative import to achieve this.
However unfortunately, the pygments package is designed to use absolute import within the package. For example, in pygments/filter/__init__.py, I found something like this:
from pygments.plugin import find_plugin_lexers
This would suggest that if I use relative import at the top level, I should also modify everywhere in the pygments package to use relative import instead of absolute import, which involves a great number of work and is not scalable.
Is there any better practice to use a “internally absolute import” third-party package?