Skip to content

Commit

Permalink
resolves #261 update Pygments to 2.18.0 (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus committed May 14, 2024
1 parent d3f5b5d commit 6f297e9
Show file tree
Hide file tree
Showing 342 changed files with 9,341 additions and 3,927 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
ruby: [ 'jruby-9.3', 'jruby-9.4', '2.6', '3.3' ]
python: [ '3.7', '3.12' ]
python: [ '3.8', '3.12' ]
platform: [ ubuntu-22.04, macos-12, windows-2019 ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/.bundle/
/.idea/
/Gemfile.lock
/pkg/
/tmp
/vendor/
*.pyc
7 changes: 5 additions & 2 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[

== Unreleased

* Drop support for Ruby 2.5
* Drop support for Python 3.6
* Drop support for Ruby 2.5.
The oldest supported is 3.6 now.
* Drop support for Python 3.6 and 3.7.
The oldest supported is 3.8 now.
* Update Pygments to 2.18.0

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

Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If a Python process dies, a new one will be spawned on the next pygments.rb requ

== System Requirements

- Python >= 3.7
- Python >= 3.8
- Ruby >= 2.6

== Installation
Expand Down
614 changes: 0 additions & 614 deletions vendor/pygments-main/Pygments-2.15.1.dist-info/RECORD

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion vendor/pygments-main/bin/pygmentize
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.10
#!/usr/bin/python3.11
# -*- coding: utf-8 -*-
import re
import sys
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Metadata-Version: 2.1
Metadata-Version: 2.3
Name: Pygments
Version: 2.15.1
Version: 2.18.0
Summary: Pygments is a syntax highlighting package written in Python.
Author-email: Georg Brandl <georg@python.org>
Maintainer: Matthäus G. Chajdas
Maintainer-email: Georg Brandl <georg@python.org>, Jean Abou Samra <jean@abou-samra.fr>
License: BSD-2-Clause
Project-URL: Homepage, https://pygments.org
Project-URL: Documentation, https://pygments.org/docs
Project-URL: Source, https://github.com/pygments/pygments
Project-URL: Bug Tracker, https://github.com/pygments/pygments/issues
Project-URL: Changelog, https://github.com/pygments/pygments/blob/master/CHANGES
Author-email: Georg Brandl <georg@python.org>
Maintainer: Matthäus G. Chajdas
Maintainer-email: Georg Brandl <georg@python.org>, Jean Abou Samra <jean@abou-samra.fr>
License: BSD-2-Clause
License-File: AUTHORS
License-File: LICENSE
Keywords: syntax highlighting
Classifier: Development Status :: 6 - Mature
Classifier: Intended Audience :: Developers
Expand All @@ -20,21 +22,20 @@ Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Text Processing :: Filters
Classifier: Topic :: Utilities
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS
Requires-Python: >=3.8
Provides-Extra: plugins
Requires-Dist: importlib-metadata ; (python_version < "3.8") and extra == 'plugins'
Provides-Extra: windows-terminal
Requires-Dist: colorama>=0.4.6; extra == 'windows-terminal'
Description-Content-Type: text/x-rst

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

Copyright 2006-2023 by the Pygments team, see ``AUTHORS``.
Copyright 2006-2024 by the Pygments team, see ``AUTHORS``.
Licensed under the BSD, see ``LICENSE`` for details.
663 changes: 663 additions & 0 deletions vendor/pygments-main/pygments-2.18.0.dist-info/RECORD

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.40.0)
Generator: hatchling 1.24.2
Root-Is-Purelib: true
Tag: py3-none-any

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Other contributors, listed alphabetically, are:
lexers
* Maxence Ahlouche -- PostgreSQL Explain lexer
* Muthiah Annamalai -- Ezhil lexer
* Nikolay Antipov -- OpenSCAD lexer
* Kumar Appaiah -- Debian control lexer
* Andreas Amann -- AppleScript lexer
* Timothy Armstrong -- Dart lexer fixes
Expand All @@ -30,6 +31,7 @@ Other contributors, listed alphabetically, are:
* Michael Bayer -- Myghty lexers
* Thomas Beale -- Archetype lexers
* John Benediktsson -- Factor lexer
* David Benjamin, Google LLC -- TLS lexer
* Trevor Bergeron -- mIRC formatter
* Vincent Bernat -- LessCSS lexer
* Christopher Bertels -- Fancy lexer
Expand All @@ -44,9 +46,11 @@ Other contributors, listed alphabetically, are:
* chebee7i -- Python traceback lexer improvements
* Hiram Chirino -- Scaml and Jade lexers
* Mauricio Caceres -- SAS and Stata lexers.
* Michael Camilleri, John Gabriele, sogaiu -- Janet lexer
* Ian Cooper -- VGL lexer
* David Corbett -- Inform, Jasmin, JSGF, Snowball, and TADS 3 lexers
* Leaf Corcoran -- MoonScript lexer
* Gabriel Corona -- ASN.1 lexer
* Christopher Creutzig -- MuPAD lexer
* Daniël W. Crompton -- Pike lexer
* Pete Curry -- bugfixes
Expand Down Expand Up @@ -112,6 +116,8 @@ Other contributors, listed alphabetically, are:
MSDOS session, BC, WDiff
* Brian R. Jackson -- Tea lexer
* Christian Jann -- ShellSession lexer
* Jonas Camillus Jeppesen -- Line numbers and line highlighting for
RTF-formatter
* Dennis Kaarsemaker -- sources.list lexer
* Dmitri Kabak -- Inferno Limbo lexer
* Igor Kalnitsky -- vhdl lexer
Expand All @@ -137,6 +143,7 @@ Other contributors, listed alphabetically, are:
* Sylvestre Ledru -- Scilab lexer
* Chee Sing Lee -- Flatline lexer
* Mark Lee -- Vala lexer
* Thomas Linder Puls -- Visual Prolog lexer
* Pete Lomax -- Phix lexer
* Valentin Lorentz -- C++ lexer improvements
* Ben Mabey -- Gherkin lexer
Expand Down Expand Up @@ -191,6 +198,7 @@ Other contributors, listed alphabetically, are:
* Kashif Rasul -- CUDA lexer
* Nathan Reed -- HLSL lexer
* Justin Reidy -- MXML lexer
* Jonathon Reinhart, Google LLC -- Soong lexer
* Norman Richards -- JSON lexer
* Corey Richardson -- Rust lexer updates
* Fabrizio Riguzzi -- cplint leder
Expand Down Expand Up @@ -237,6 +245,7 @@ Other contributors, listed alphabetically, are:
* Erick Tryzelaar -- Felix lexer
* Alexander Udalov -- Kotlin lexer improvements
* Thomas Van Doren -- Chapel lexer
* Dave Van Ee -- Uxntal lexer updates
* Daniele Varrazzo -- PostgreSQL lexers
* Abe Voelker -- OpenEdge ABL lexer
* Pepijn de Vos -- HTML formatter CTags support
Expand Down Expand Up @@ -266,5 +275,9 @@ Other contributors, listed alphabetically, are:
* Marc Auberer -- Spice lexer
* Amr Hesham -- Carbon lexer
* diskdance -- Wikitext lexer
* vanillajonathan -- PRQL lexer
* Nikolay Antipov -- OpenSCAD lexer
* Markus Meyer, Nextron Systems -- YARA lexer
* Hannes Römer -- Mojo lexer

Many thanks for all contributions!
4 changes: 2 additions & 2 deletions vendor/pygments-main/pygments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
.. _Pygments master branch:
https://github.com/pygments/pygments/archive/master.zip#egg=Pygments-dev
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from io import StringIO, BytesIO

__version__ = '2.15.1'
__version__ = '2.18.0'
__docformat__ = 'restructuredtext'

__all__ = ['lex', 'format', 'highlight']
Expand Down
2 changes: 1 addition & 1 deletion vendor/pygments-main/pygments/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Main entry point for ``python -m pygments``.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down
24 changes: 12 additions & 12 deletions vendor/pygments-main/pygments/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Command line interface.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down Expand Up @@ -68,19 +68,19 @@ def _print_help(what, name):
try:
if what == 'lexer':
cls = get_lexer_by_name(name)
print("Help on the %s lexer:" % cls.name)
print(f"Help on the {cls.name} lexer:")
print(dedent(cls.__doc__))
elif what == 'formatter':
cls = find_formatter_class(name)
print("Help on the %s formatter:" % cls.name)
print(f"Help on the {cls.name} formatter:")
print(dedent(cls.__doc__))
elif what == 'filter':
cls = find_filter_class(name)
print("Help on the %s filter:" % name)
print(f"Help on the {name} filter:")
print(dedent(cls.__doc__))
return 0
except (AttributeError, ValueError):
print("%s not found!" % what, file=sys.stderr)
print(f"{what} not found!", file=sys.stderr)
return 1


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

elif what == 'formatter':
print()
Expand All @@ -112,7 +112,7 @@ def _print_list(what):
info.append(tup)
info.sort()
for i in info:
print(('* %s\n %s %s') % i)
print(('* {}\n {} {}').format(*i))

elif what == 'filter':
print()
Expand All @@ -122,7 +122,7 @@ def _print_list(what):
for name in get_all_filters():
cls = find_filter_class(name)
print("* " + name + ':')
print(" %s" % docstring_headline(cls))
print(f" {docstring_headline(cls)}")

elif what == 'style':
print()
Expand All @@ -132,7 +132,7 @@ def _print_list(what):
for name in get_all_styles():
cls = get_style_by_name(name)
print("* " + name + ':')
print(" %s" % docstring_headline(cls))
print(f" {docstring_headline(cls)}")


def _print_list_as_json(requested_items):
Expand Down Expand Up @@ -185,8 +185,8 @@ def main_inner(parser, argns):
return 0

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

def is_only_option(opt):
Expand Down Expand Up @@ -659,7 +659,7 @@ def main(args=sys.argv):
msg = info[-1].strip()
if len(info) >= 3:
# extract relevant file and position info
msg += '\n (f%s)' % info[-2].split('\n')[0].strip()[1:]
msg += '\n (f{})'.format(info[-2].split('\n')[0].strip()[1:])
print(file=sys.stderr)
print('*** Error while highlighting:', file=sys.stderr)
print(msg, file=sys.stderr)
Expand Down
10 changes: 5 additions & 5 deletions vendor/pygments-main/pygments/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Format colored console output.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand All @@ -27,12 +27,12 @@
"brightmagenta", "brightcyan", "white"]

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

del d, l, x
del dark, light, x

codes["white"] = codes["bold"]

Expand Down
5 changes: 2 additions & 3 deletions vendor/pygments-main/pygments/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Module that implements the default filter.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down Expand Up @@ -62,8 +62,7 @@ class FunctionFilter(Filter):

def __init__(self, **options):
if not hasattr(self, 'function'):
raise TypeError('%r used without bound function' %
self.__class__.__name__)
raise TypeError(f'{self.__class__.__name__!r} used without bound function')
Filter.__init__(self, **options)

def filter(self, lexer, stream):
Expand Down
8 changes: 4 additions & 4 deletions vendor/pygments-main/pygments/filters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Module containing filter lookup functions and default
filters.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down Expand Up @@ -39,7 +39,7 @@ def get_filter_by_name(filtername, **options):
if cls:
return cls(**options)
else:
raise ClassNotFound('filter %r not found' % filtername)
raise ClassNotFound(f'filter {filtername!r} not found')


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

def filter(self, lexer, stream):
regex = self.tag_re
Expand Down
7 changes: 6 additions & 1 deletion vendor/pygments-main/pygments/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Base formatter class.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

Expand Down Expand Up @@ -122,3 +122,8 @@ def format(self, tokensource, outfile):
# wrap the outfile in a StreamWriter
outfile = codecs.lookup(self.encoding)[3](outfile)
return self.format_unencoded(tokensource, outfile)

# Allow writing Formatter[str] or Formatter[bytes]. That's equivalent to
# Formatter. This helps when using third-party type stubs from typeshed.
def __class_getitem__(cls, name):
return cls
Loading

0 comments on commit 6f297e9

Please sign in to comment.