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

bugfix: Pin pygments pending improved conversion to urwid #1433

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented Oct 4, 2023

What does this PR do, and why?

This is intended to provide a temporary quick fix for #1431, to enable the themes to continue working for now with main, by pinning pygments at ~=2.15.1.

External discussion & connections

How did you test this?

  • Manually - Behavioral changes
  • Manually - Visual changes
  • Adapting existing automated tests
  • Adding automated tests for new behavior (or missing tests)
  • Existing automated tests should already cover this (only a refactor of tested code)

Self-review checklist for each commit

  • It is a minimal coherent idea
  • It has a commit summary following the documented style (title & body)
  • It has a commit summary describing the motivation and reasoning for the change
  • It individually passes linting and tests
  • It contains test additions for any new behavior
  • It flows clearly from a previous branch commit, and/or prepares for the next commit

Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold strong' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

Longer-term we should improve the pygments to urwid translation logic to
allow these styles to work and an upgrade to later pygments versions,
but for now this allows these themes to continue working as before.

Fixes zulip#1431.
@neiljp neiljp added high priority should be done as soon as possible bug: crash area: colors/styles/themes labels Oct 4, 2023
@zulipbot zulipbot added the size: XS [Automatic label added by zulipbot] label Oct 4, 2023
@neiljp neiljp force-pushed the 2023-10-03-pygments-workaround branch from 48e995a to 3f4f7da Compare October 4, 2023 05:53
@neiljp neiljp marked this pull request as ready for review October 4, 2023 06:03
@neiljp neiljp merged commit 2d25ba9 into zulip:main Oct 4, 2023
20 checks passed
@neiljp neiljp added this to the Next Release milestone Oct 4, 2023
jrijul1201 added a commit to jrijul1201/zulip-terminal that referenced this pull request Dec 19, 2023
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold strong' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This work would represent a clean fix for zulip#1431, which was temporarily
fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Add method `translate_styles` that manually converts the pygments
`bold italic` style into the urwid-compatible `bold, italics`.

Tests added.

Fixes part of zulip#1434.
jrijul1201 added a commit to jrijul1201/zulip-terminal that referenced this pull request Dec 20, 2023
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold strong' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This work would represent a clean fix for zulip#1431, which was temporarily
fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Add method `translate_styles` that manually converts the pygments
`bold italic` style into the urwid-compatible `bold, italics`.

Tests added.

Fixes part of zulip#1434.
jrijul1201 added a commit to jrijul1201/zulip-terminal that referenced this pull request Dec 20, 2023
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold strong' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This work would represent a clean fix for zulip#1431, which was temporarily
fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Add method `translate_styles` that manually converts the pygments
`bold italic` style into the urwid-compatible `bold, italics`.

Tests added.

Fixes part of zulip#1434.
jrijul1201 added a commit to jrijul1201/zulip-terminal that referenced this pull request Dec 21, 2023
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold strong' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This was temporarily fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Method `translate_styles` manually converts the pygments `bold italic`
style into the urwid-compatible `bold, italics` is there.

Unpin Pygments from ~=2.15.1 to >=2.14.0.

Fixes part of zulip#1434.
jrijul1201 added a commit to jrijul1201/zulip-terminal that referenced this pull request Dec 22, 2023
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold strong' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This was temporarily fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Method `translate_styles` manually converts the pygments `bold italic`
style into the urwid-compatible `bold, italics` is there.

Unpin Pygments from ~=2.15.1 to >=2.14.0.

Fixes part of zulip#1434.
jrijul1201 added a commit to jrijul1201/zulip-terminal that referenced this pull request Dec 22, 2023
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold strong' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This work would represent a clean fix for zulip#1431, which was temporarily
fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Add method `translate_styles` that manually converts the pygments
`bold italic` style into the urwid-compatible `bold, italics`.

Tests added.

Fixes part of zulip#1434.
jrijul1201 added a commit to jrijul1201/zulip-terminal that referenced this pull request Dec 22, 2023
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold strong' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This was temporarily fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Method `translate_styles` manually converts the pygments `bold italic`
style into the urwid-compatible `bold, italics` is there.

Unpin Pygments from ~=2.15.1 to >=2.14.0.

Fixes part of zulip#1434.
jrijul1201 added a commit to jrijul1201/zulip-terminal that referenced this pull request Dec 22, 2023
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold strong' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This work would represent a clean fix for zulip#1431, which was temporarily
fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Add method `translate_styles` that manually converts the pygments
`bold italic` style into the urwid-compatible `bold, italics`.

Tests added.

Fixes part of zulip#1434.
neiljp pushed a commit to jrijul1201/zulip-terminal that referenced this pull request Jan 8, 2024
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold italic' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This work would represent a clean fix for zulip#1431, which was temporarily
fixed by pinning pygments at ~=2.15.1 in zulip#1433.

This minimally handles spaces and the shortened `italic` in pygments
styles, sufficient to resolve the current style issue. Note that other
pygments styles in themes that we do not yet use may need additional
translation or adjustment.

Tests added.

Fixes part of zulip#1434.
neiljp pushed a commit to jrijul1201/zulip-terminal that referenced this pull request Jan 8, 2024
The previous commit fixes the issue zulip#1431 that was temporarily
fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Subsequent versions of pygments have since been released, but an upper
limit of 2.18.0 is included, since that unreleased version depends on
Python3.8 and could make ZT uninstallable on older pythons.

Fixes part of zulip#1434.
neiljp pushed a commit to jrijul1201/zulip-terminal that referenced this pull request Jan 8, 2024
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold italic' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This work would represent a clean fix for zulip#1431, which was temporarily
fixed by pinning pygments at ~=2.15.1 in zulip#1433.

This minimally handles spaces and the shortened `italic` in pygments
styles, sufficient to resolve the current style issue. Note that other
pygments styles in themes that we do not yet use may need additional
translation or adjustment.

Tests added.

Fixes part of zulip#1434.
neiljp pushed a commit to jrijul1201/zulip-terminal that referenced this pull request Jan 8, 2024
The previous commit fixes the issue zulip#1431 that was temporarily
fixed by pinning pygments at ~=2.15.1 in zulip#1433.

Subsequent versions of pygments have since been released, but an upper
limit of 2.18.0 is included, since that unreleased version depends on
Python3.8 and could make ZT uninstallable on older pythons.

Fixes part of zulip#1434.
neiljp pushed a commit that referenced this pull request Jan 8, 2024
Pygments 2.16.0 introduced a style to support a combination of bold and
italic styling in pygments/pygments#2444. Both of our gruvbox themes and
the light native theme gain a 'bold italic' style via pygments as a
result, which urwid fails to parse and blocks the application from
loading.

This work would represent a clean fix for #1431, which was temporarily
fixed by pinning pygments at ~=2.15.1 in #1433.

This minimally handles spaces and the shortened `italic` in pygments
styles, sufficient to resolve the current style issue. Note that other
pygments styles in themes that we do not yet use may need additional
translation or adjustment.

Tests added.

Fixes part of #1434.
neiljp pushed a commit that referenced this pull request Jan 8, 2024
The previous commit fixes the issue #1431 that was temporarily
fixed by pinning pygments at ~=2.15.1 in #1433.

Subsequent versions of pygments have since been released, but an upper
limit of 2.18.0 is included, since that unreleased version depends on
Python3.8 and could make ZT uninstallable on older pythons.

Fixes part of #1434.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: colors/styles/themes bug: crash high priority should be done as soon as possible size: XS [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gruvbox & zt_light themes don't work with pygments 2.16.x
2 participants