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

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

Open
sarnold opened this issue Jan 26, 2025 · 0 comments
Open

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

sarnold opened this issue Jan 26, 2025 · 0 comments

Comments

@sarnold
Copy link

sarnold commented Jan 26, 2025

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"
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