Skip to content

Commit 6f297e9

Browse files
authored
resolves #261 update Pygments to 2.18.0 (#262)
1 parent d3f5b5d commit 6f297e9

File tree

342 files changed

+9341
-3927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+9341
-3927
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
matrix:
2323
ruby: [ 'jruby-9.3', 'jruby-9.4', '2.6', '3.3' ]
24-
python: [ '3.7', '3.12' ]
24+
python: [ '3.8', '3.12' ]
2525
platform: [ ubuntu-22.04, macos-12, windows-2019 ]
2626
runs-on: ${{ matrix.platform }}
2727
steps:

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/.bundle/
12
/.idea/
23
/Gemfile.lock
34
/pkg/
45
/tmp
6+
/vendor/
57
*.pyc

CHANGELOG.adoc

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
77

88
== Unreleased
99

10-
* Drop support for Ruby 2.5
11-
* Drop support for Python 3.6
10+
* Drop support for Ruby 2.5.
11+
The oldest supported is 3.6 now.
12+
* Drop support for Python 3.6 and 3.7.
13+
The oldest supported is 3.8 now.
14+
* Update Pygments to 2.18.0
1215

1316
== 2.4.1 (2023-11-13) - @slonopotamus
1417

README.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If a Python process dies, a new one will be spawned on the next pygments.rb requ
2222

2323
== System Requirements
2424

25-
- Python >= 3.7
25+
- Python >= 3.8
2626
- Ruby >= 2.6
2727

2828
== Installation

vendor/pygments-main/Pygments-2.15.1.dist-info/RECORD

-614
This file was deleted.

vendor/pygments-main/Pygments-2.15.1.dist-info/top_level.txt

-1
This file was deleted.

vendor/pygments-main/bin/pygmentize

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3.10
1+
#!/usr/bin/python3.11
22
# -*- coding: utf-8 -*-
33
import re
44
import sys
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
Metadata-Version: 2.1
1+
Metadata-Version: 2.3
22
Name: Pygments
3-
Version: 2.15.1
3+
Version: 2.18.0
44
Summary: Pygments is a syntax highlighting package written in Python.
5-
Author-email: Georg Brandl <[email protected]>
6-
Maintainer: Matthäus G. Chajdas
7-
Maintainer-email: Georg Brandl <[email protected]>, Jean Abou Samra <[email protected]>
8-
License: BSD-2-Clause
95
Project-URL: Homepage, https://pygments.org
106
Project-URL: Documentation, https://pygments.org/docs
117
Project-URL: Source, https://github.com/pygments/pygments
128
Project-URL: Bug Tracker, https://github.com/pygments/pygments/issues
139
Project-URL: Changelog, https://github.com/pygments/pygments/blob/master/CHANGES
10+
Author-email: Georg Brandl <[email protected]>
11+
Maintainer: Matthäus G. Chajdas
12+
Maintainer-email: Georg Brandl <[email protected]>, Jean Abou Samra <[email protected]>
13+
License: BSD-2-Clause
14+
License-File: AUTHORS
15+
License-File: LICENSE
1416
Keywords: syntax highlighting
1517
Classifier: Development Status :: 6 - Mature
1618
Classifier: Intended Audience :: Developers
@@ -20,21 +22,20 @@ Classifier: License :: OSI Approved :: BSD License
2022
Classifier: Operating System :: OS Independent
2123
Classifier: Programming Language :: Python
2224
Classifier: Programming Language :: Python :: 3
23-
Classifier: Programming Language :: Python :: 3.7
2425
Classifier: Programming Language :: Python :: 3.8
2526
Classifier: Programming Language :: Python :: 3.9
2627
Classifier: Programming Language :: Python :: 3.10
2728
Classifier: Programming Language :: Python :: 3.11
29+
Classifier: Programming Language :: Python :: 3.12
2830
Classifier: Programming Language :: Python :: Implementation :: CPython
2931
Classifier: Programming Language :: Python :: Implementation :: PyPy
3032
Classifier: Topic :: Text Processing :: Filters
3133
Classifier: Topic :: Utilities
32-
Requires-Python: >=3.7
33-
Description-Content-Type: text/x-rst
34-
License-File: LICENSE
35-
License-File: AUTHORS
34+
Requires-Python: >=3.8
3635
Provides-Extra: plugins
37-
Requires-Dist: importlib-metadata ; (python_version < "3.8") and extra == 'plugins'
36+
Provides-Extra: windows-terminal
37+
Requires-Dist: colorama>=0.4.6; extra == 'windows-terminal'
38+
Description-Content-Type: text/x-rst
3839

3940
Pygments
4041
~~~~~~~~
@@ -52,5 +53,5 @@ are:
5253
formats that PIL supports and ANSI sequences
5354
* it is usable as a command-line tool and as a library
5455

55-
Copyright 2006-2023 by the Pygments team, see ``AUTHORS``.
56+
Copyright 2006-2024 by the Pygments team, see ``AUTHORS``.
5657
Licensed under the BSD, see ``LICENSE`` for details.

vendor/pygments-main/pygments-2.18.0.dist-info/RECORD

+663
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Wheel-Version: 1.0
2-
Generator: bdist_wheel (0.40.0)
2+
Generator: hatchling 1.24.2
33
Root-Is-Purelib: true
44
Tag: py3-none-any
5-

vendor/pygments-main/Pygments-2.15.1.dist-info/AUTHORS vendor/pygments-main/pygments-2.18.0.dist-info/licenses/AUTHORS

+13
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Other contributors, listed alphabetically, are:
1313
lexers
1414
* Maxence Ahlouche -- PostgreSQL Explain lexer
1515
* Muthiah Annamalai -- Ezhil lexer
16+
* Nikolay Antipov -- OpenSCAD lexer
1617
* Kumar Appaiah -- Debian control lexer
1718
* Andreas Amann -- AppleScript lexer
1819
* Timothy Armstrong -- Dart lexer fixes
@@ -30,6 +31,7 @@ Other contributors, listed alphabetically, are:
3031
* Michael Bayer -- Myghty lexers
3132
* Thomas Beale -- Archetype lexers
3233
* John Benediktsson -- Factor lexer
34+
* David Benjamin, Google LLC -- TLS lexer
3335
* Trevor Bergeron -- mIRC formatter
3436
* Vincent Bernat -- LessCSS lexer
3537
* Christopher Bertels -- Fancy lexer
@@ -44,9 +46,11 @@ Other contributors, listed alphabetically, are:
4446
* chebee7i -- Python traceback lexer improvements
4547
* Hiram Chirino -- Scaml and Jade lexers
4648
* Mauricio Caceres -- SAS and Stata lexers.
49+
* Michael Camilleri, John Gabriele, sogaiu -- Janet lexer
4750
* Ian Cooper -- VGL lexer
4851
* David Corbett -- Inform, Jasmin, JSGF, Snowball, and TADS 3 lexers
4952
* Leaf Corcoran -- MoonScript lexer
53+
* Gabriel Corona -- ASN.1 lexer
5054
* Christopher Creutzig -- MuPAD lexer
5155
* Daniël W. Crompton -- Pike lexer
5256
* Pete Curry -- bugfixes
@@ -112,6 +116,8 @@ Other contributors, listed alphabetically, are:
112116
MSDOS session, BC, WDiff
113117
* Brian R. Jackson -- Tea lexer
114118
* Christian Jann -- ShellSession lexer
119+
* Jonas Camillus Jeppesen -- Line numbers and line highlighting for
120+
RTF-formatter
115121
* Dennis Kaarsemaker -- sources.list lexer
116122
* Dmitri Kabak -- Inferno Limbo lexer
117123
* Igor Kalnitsky -- vhdl lexer
@@ -137,6 +143,7 @@ Other contributors, listed alphabetically, are:
137143
* Sylvestre Ledru -- Scilab lexer
138144
* Chee Sing Lee -- Flatline lexer
139145
* Mark Lee -- Vala lexer
146+
* Thomas Linder Puls -- Visual Prolog lexer
140147
* Pete Lomax -- Phix lexer
141148
* Valentin Lorentz -- C++ lexer improvements
142149
* Ben Mabey -- Gherkin lexer
@@ -191,6 +198,7 @@ Other contributors, listed alphabetically, are:
191198
* Kashif Rasul -- CUDA lexer
192199
* Nathan Reed -- HLSL lexer
193200
* Justin Reidy -- MXML lexer
201+
* Jonathon Reinhart, Google LLC -- Soong lexer
194202
* Norman Richards -- JSON lexer
195203
* Corey Richardson -- Rust lexer updates
196204
* Fabrizio Riguzzi -- cplint leder
@@ -237,6 +245,7 @@ Other contributors, listed alphabetically, are:
237245
* Erick Tryzelaar -- Felix lexer
238246
* Alexander Udalov -- Kotlin lexer improvements
239247
* Thomas Van Doren -- Chapel lexer
248+
* Dave Van Ee -- Uxntal lexer updates
240249
* Daniele Varrazzo -- PostgreSQL lexers
241250
* Abe Voelker -- OpenEdge ABL lexer
242251
* Pepijn de Vos -- HTML formatter CTags support
@@ -266,5 +275,9 @@ Other contributors, listed alphabetically, are:
266275
* Marc Auberer -- Spice lexer
267276
* Amr Hesham -- Carbon lexer
268277
* diskdance -- Wikitext lexer
278+
* vanillajonathan -- PRQL lexer
279+
* Nikolay Antipov -- OpenSCAD lexer
280+
* Markus Meyer, Nextron Systems -- YARA lexer
281+
* Hannes Römer -- Mojo lexer
269282

270283
Many thanks for all contributions!

vendor/pygments-main/pygments/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
.. _Pygments master branch:
2222
https://github.com/pygments/pygments/archive/master.zip#egg=Pygments-dev
2323
24-
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
24+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
2525
:license: BSD, see LICENSE for details.
2626
"""
2727
from io import StringIO, BytesIO
2828

29-
__version__ = '2.15.1'
29+
__version__ = '2.18.0'
3030
__docformat__ = 'restructuredtext'
3131

3232
__all__ = ['lex', 'format', 'highlight']

vendor/pygments-main/pygments/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Main entry point for ``python -m pygments``.
66
7-
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
88
:license: BSD, see LICENSE for details.
99
"""
1010

vendor/pygments-main/pygments/cmdline.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Command line interface.
66
7-
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
88
:license: BSD, see LICENSE for details.
99
"""
1010

@@ -68,19 +68,19 @@ def _print_help(what, name):
6868
try:
6969
if what == 'lexer':
7070
cls = get_lexer_by_name(name)
71-
print("Help on the %s lexer:" % cls.name)
71+
print(f"Help on the {cls.name} lexer:")
7272
print(dedent(cls.__doc__))
7373
elif what == 'formatter':
7474
cls = find_formatter_class(name)
75-
print("Help on the %s formatter:" % cls.name)
75+
print(f"Help on the {cls.name} formatter:")
7676
print(dedent(cls.__doc__))
7777
elif what == 'filter':
7878
cls = find_filter_class(name)
79-
print("Help on the %s filter:" % name)
79+
print(f"Help on the {name} filter:")
8080
print(dedent(cls.__doc__))
8181
return 0
8282
except (AttributeError, ValueError):
83-
print("%s not found!" % what, file=sys.stderr)
83+
print(f"{what} not found!", file=sys.stderr)
8484
return 1
8585

8686

@@ -97,7 +97,7 @@ def _print_list(what):
9797
info.append(tup)
9898
info.sort()
9999
for i in info:
100-
print(('* %s\n %s %s') % i)
100+
print(('* {}\n {} {}').format(*i))
101101

102102
elif what == 'formatter':
103103
print()
@@ -112,7 +112,7 @@ def _print_list(what):
112112
info.append(tup)
113113
info.sort()
114114
for i in info:
115-
print(('* %s\n %s %s') % i)
115+
print(('* {}\n {} {}').format(*i))
116116

117117
elif what == 'filter':
118118
print()
@@ -122,7 +122,7 @@ def _print_list(what):
122122
for name in get_all_filters():
123123
cls = find_filter_class(name)
124124
print("* " + name + ':')
125-
print(" %s" % docstring_headline(cls))
125+
print(f" {docstring_headline(cls)}")
126126

127127
elif what == 'style':
128128
print()
@@ -132,7 +132,7 @@ def _print_list(what):
132132
for name in get_all_styles():
133133
cls = get_style_by_name(name)
134134
print("* " + name + ':')
135-
print(" %s" % docstring_headline(cls))
135+
print(f" {docstring_headline(cls)}")
136136

137137

138138
def _print_list_as_json(requested_items):
@@ -185,8 +185,8 @@ def main_inner(parser, argns):
185185
return 0
186186

187187
if argns.V:
188-
print('Pygments version %s, (c) 2006-2023 by Georg Brandl, Matthäus '
189-
'Chajdas and contributors.' % __version__)
188+
print(f'Pygments version {__version__}, (c) 2006-2024 by Georg Brandl, Matthäus '
189+
'Chajdas and contributors.')
190190
return 0
191191

192192
def is_only_option(opt):
@@ -659,7 +659,7 @@ def main(args=sys.argv):
659659
msg = info[-1].strip()
660660
if len(info) >= 3:
661661
# extract relevant file and position info
662-
msg += '\n (f%s)' % info[-2].split('\n')[0].strip()[1:]
662+
msg += '\n (f{})'.format(info[-2].split('\n')[0].strip()[1:])
663663
print(file=sys.stderr)
664664
print('*** Error while highlighting:', file=sys.stderr)
665665
print(msg, file=sys.stderr)

vendor/pygments-main/pygments/console.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Format colored console output.
66
7-
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
88
:license: BSD, see LICENSE for details.
99
"""
1010

@@ -27,12 +27,12 @@
2727
"brightmagenta", "brightcyan", "white"]
2828

2929
x = 30
30-
for d, l in zip(dark_colors, light_colors):
31-
codes[d] = esc + "%im" % x
32-
codes[l] = esc + "%im" % (60 + x)
30+
for dark, light in zip(dark_colors, light_colors):
31+
codes[dark] = esc + "%im" % x
32+
codes[light] = esc + "%im" % (60 + x)
3333
x += 1
3434

35-
del d, l, x
35+
del dark, light, x
3636

3737
codes["white"] = codes["bold"]
3838

vendor/pygments-main/pygments/filter.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Module that implements the default filter.
66
7-
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
88
:license: BSD, see LICENSE for details.
99
"""
1010

@@ -62,8 +62,7 @@ class FunctionFilter(Filter):
6262

6363
def __init__(self, **options):
6464
if not hasattr(self, 'function'):
65-
raise TypeError('%r used without bound function' %
66-
self.__class__.__name__)
65+
raise TypeError(f'{self.__class__.__name__!r} used without bound function')
6766
Filter.__init__(self, **options)
6867

6968
def filter(self, lexer, stream):

vendor/pygments-main/pygments/filters/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Module containing filter lookup functions and default
66
filters.
77
8-
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
8+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
99
:license: BSD, see LICENSE for details.
1010
"""
1111

@@ -39,7 +39,7 @@ def get_filter_by_name(filtername, **options):
3939
if cls:
4040
return cls(**options)
4141
else:
42-
raise ClassNotFound('filter %r not found' % filtername)
42+
raise ClassNotFound(f'filter {filtername!r} not found')
4343

4444

4545
def get_all_filters():
@@ -79,9 +79,9 @@ def __init__(self, **options):
7979
Filter.__init__(self, **options)
8080
tags = get_list_opt(options, 'codetags',
8181
['XXX', 'TODO', 'FIXME', 'BUG', 'NOTE'])
82-
self.tag_re = re.compile(r'\b(%s)\b' % '|'.join([
82+
self.tag_re = re.compile(r'\b({})\b'.format('|'.join([
8383
re.escape(tag) for tag in tags if tag
84-
]))
84+
])))
8585

8686
def filter(self, lexer, stream):
8787
regex = self.tag_re

vendor/pygments-main/pygments/formatter.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Base formatter class.
66
7-
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
7+
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
88
:license: BSD, see LICENSE for details.
99
"""
1010

@@ -122,3 +122,8 @@ def format(self, tokensource, outfile):
122122
# wrap the outfile in a StreamWriter
123123
outfile = codecs.lookup(self.encoding)[3](outfile)
124124
return self.format_unencoded(tokensource, outfile)
125+
126+
# Allow writing Formatter[str] or Formatter[bytes]. That's equivalent to
127+
# Formatter. This helps when using third-party type stubs from typeshed.
128+
def __class_getitem__(cls, name):
129+
return cls

0 commit comments

Comments
 (0)