-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
I've been using this tool in several tox virtual environment workflows (mainly documentation, eg, this SUM template repo and at some point "pip install" broke (silently in my case). The primary symptom was a diagram with blank icons as documented in issue #229 . Depending on the exact workflow, this could easily result in installation errors (eg, issue #921 ) or python traceback when trying to generate the diagram.
It took some time to track this down, and the fix does not require moving the resources directory. Yes, it would be good to handle the resources tree as python package data, but doing that is orthogonal to fixing this problem. <= this would also mean exposing icons via the proper importlib mechanisms but again, that is a different issue.
The fix to the broken package install is this commit:
diff --git a/pyproject.toml b/pyproject.toml
index 42a0ddd..0d85c60 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,7 +11,12 @@ authors = ["mingrammer <[email protected]>"]
readme = "README.md"
homepage = "https://diagrams.mingrammer.com"
repository = "https://github.com/mingrammer/diagrams"
-include = ["resources/**/*"]
+packages = [
+ { include = "diagrams", from = "." }
+]
+include = [
+ { path = "resources", format = ["sdist", "wheel"] }
+]
[tool.poetry.scripts]
diagrams="diagrams.cli:main"