Skip to content

Use a more lenient dependency version range specification for pygments #8857

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

Closed
wants to merge 3 commits into from
Closed

Use a more lenient dependency version range specification for pygments #8857

wants to merge 3 commits into from

Conversation

jayaddison
Copy link

@jayaddison jayaddison commented Jan 25, 2023

Description

Between pygments v2.12.0 and v2.13.0, pygments/pygments@147b22f adjusted the way that whitespace is produced in HTML documents.

This caused a django-rest-framework unit test to begin failing, which was resolved in #8530 by configuring a specific dependency version (pin) on pygments==2.12.0.

This changeset restores the previous lower-bound-and-beyond (albeit within major) version range for pygments and resolves the unit test failure by collecting and concatenating string content from within the HTML produced by pygments (including nested elements).

Refs #8530.

@jayaddison
Copy link
Author

Evidently I didn't test these changes well enough, my apologies :/ I'll look into the test case failures (and some deprecation warnings about version constraints) soon.

@@ -41,7 +41,7 @@
</code></pre>
<p>indented</p>
<h2 id="hash-style-header">hash style header</h2>
<div class="highlight"><pre><span></span><span class="p">[{</span><span class="w"></span><br /><span class="w"> </span><span class="nt">&quot;alpha&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"></span><br /><span class="w"> </span><span class="nt">&quot;beta&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;this is a string&quot;</span><span class="w"></span><br /><span class="p">}]</span><span class="w"></span><br /></pre></div>
<div class="highlight"><pre><span></span><span class="p">[{</span><br /><span class="w"> </span><span class="nt">&quot;alpha&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><br /><span class="w"> </span><span class="nt">&quot;beta&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;this is a string&quot;</span><br /><span class="p">}]</span><br /></pre></div>
Copy link
Author

Choose a reason for hiding this comment

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

Note: this test expectation seems to be relatively tightly coupled to the installed pygments dependency version.

@jayaddison
Copy link
Author

I didn't feel highly confident in the implications of this change, and am closing the pull request as stale. Feel free to recover and merge the changes if they're useful; please double-check for any side-effects though, since I wasn't diligent about that here.

@jayaddison jayaddison closed this Mar 5, 2023
@jayaddison jayaddison deleted the pr-8530-followup/unpin-pygments-dependency-version branch March 5, 2023 19:19
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.

1 participant