Skip to content

Meta-issue (and fix) for missing icons and install problems #1099

@sarnold

Description

@sarnold

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions