Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Andrei-Pozolotin opened this issue Jan 4, 2025 · 0 comments

Comments

@Andrei-Pozolotin
Copy link

Andrei-Pozolotin commented Jan 4, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant