cssutils icon indicating copy to clipboard operation
cssutils copied to clipboard

vendoring.errors.VendoringError: Encountered import that cannot be transformed for a namespace

Open Andrei-Pozolotin opened this issue 11 months ago • 0 comments

when cssutils is processed by vendoring: https://github.com/pradyunsg/vendoring

it results in errors like:

  vendoring.errors.VendoringError: Encountered import that cannot be transformed for a namespace.
  File "src/auto_mate_1/vendor/cssutils/css/cssrule.py", line 6
    import cssutils.util

which could be corrected with pyproject.toml stanza:

[tool.vendoring.transformations]
substitute = [
	{ match="import cssutils.profiles", replace="from cssutils import profiles as cssutils_profiles" },
	{ match="import cssutils.stylesheets", replace="from cssutils import stylesheets as cssutils_stylesheets" },
	{ match="import cssutils.helper", replace="from cssutils import helper as cssutils_helper" },
	{ match="import cssutils.util", replace="from cssutils import util as cssutils_util" },
	{ match="cssutils.profiles", replace="cssutils_profiles" },
	{ match="cssutils.stylesheets", replace="cssutils_stylesheets" },
	{ match="cssutils.helper", replace="cssutils_helper" },
	{ match="cssutils.util", replace="cssutils_util" },
] 

perhaps cssutils could benefit from package namespace correction?

Andrei-Pozolotin avatar Jan 04 '25 17:01 Andrei-Pozolotin