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

Remove ansi2html. #2721

Merged
merged 5 commits into from
Jan 9, 2024
Merged

Remove ansi2html. #2721

merged 5 commits into from
Jan 9, 2024

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Jan 8, 2024

Resolve #2713 by removing the ansi2html package, upon investigation the stacktrace weren't colored anyway.

dash/_jupyter.py Outdated
html_str = re.sub("background-color:[^;]+;", "", html_str)

return html_str, 500
return ansi_stacktrace, 500
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the comment above:

# Use IPython traceback formatting to build colored ANSI traceback
# string

Is no longer true for some reason? Does worry me a little that maybe in some cases the color will creep in and lead to ugly junk in the output. I wonder if instead of FormattedTB we could use something simpler like traceback.format_exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I didn't see the color, without dev_tools_prune_errors=False I only had one line and the color was dark red, in the devtools error had the escaped ansi symbols.

There is a NoColor mode that should do.

@@ -7,7 +7,7 @@ flake8==3.9.2
flaky==3.7.0
flask-talisman==1.0.0
isort==4.3.21;python_version<"3.7"
mimesis
mimesis<=11.1.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NBD since this is only in requires-ci, but why is this lock needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest version introduced a union type like str | int and that is only supported in recent python versions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK yeah weird:

To work with Mimesis on Python versions 3.8 and 3.9, the final compatible version is Mimesis 11.1.0. Install this specific version to ensure compatibility.

but even v12.1.0 says

Requires: Python >=3.8, <4.0

Wonder why they didn't just bake that first statement into the python_requires 🤔

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 Thanks!

@T4rk1n T4rk1n merged commit 000ec18 into dev Jan 9, 2024
3 checks passed
@T4rk1n T4rk1n deleted the remove-ansi2html branch January 9, 2024 17:54
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

Successfully merging this pull request may close these issues.

[Feature Request] Remove dependency on LGPL licensed ansi2html
2 participants