Skip to content

Commit 07bbeb8

Browse files
committed
drop python3.6 support
python 3.6 reached end of life on 2021-12-23 Committed via https://github.com/asottile/all-repos
1 parent 2883123 commit 07bbeb8

7 files changed

+15
-12
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ repos:
2121
rev: v2.6.0
2222
hooks:
2323
- id: reorder-python-imports
24-
args: [--py3-plus]
24+
args: [--py37-plus, --add-import, 'from __future__ import annotations']
2525
- repo: https://github.com/asottile/pyupgrade
2626
rev: v2.31.0
2727
hooks:
2828
- id: pyupgrade
29-
args: [--py36-plus]
29+
args: [--py37-plus]
3030
- repo: https://github.com/asottile/add-trailing-comma
3131
rev: v2.2.1
3232
hooks:

azure-pipelines.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ resources:
1010
type: github
1111
endpoint: github
1212
name: asottile/azure-pipeline-templates
13-
ref: refs/tags/v2.1.0
13+
ref: refs/tags/v2.4.0
1414

1515
jobs:
1616
- template: job--python-tox.yml@asottile
1717
parameters:
18-
toxenvs: [pypy3, py36, py37, py38]
18+
toxenvs: [py37, py38, py39, py310]
1919
os: linux

markdown_code_blocks.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
from __future__ import annotations
2+
13
import argparse
2-
from typing import Optional
34
from typing import Sequence
4-
from typing import Type
55

66
import mistune
77
import pygments.formatters
@@ -10,7 +10,7 @@
1010

1111

1212
class CodeRenderer(mistune.HTMLRenderer):
13-
def block_code(self, code: str, info: Optional[str] = None) -> str:
13+
def block_code(self, code: str, info: str | None = None) -> str:
1414
try:
1515
lexer = pygments.lexers.get_lexer_by_name(info, stripnl=False)
1616
cssclass = f'highlight {info}'
@@ -23,12 +23,12 @@ def block_code(self, code: str, info: Optional[str] = None) -> str:
2323

2424
def highlight(
2525
doc: str,
26-
Renderer: Type[mistune.HTMLRenderer] = CodeRenderer,
26+
Renderer: type[mistune.HTMLRenderer] = CodeRenderer,
2727
) -> str:
2828
return mistune.Markdown(Renderer())(doc)
2929

3030

31-
def main(argv: Optional[Sequence[str]] = None) -> int:
31+
def main(argv: Sequence[str] | None = None) -> int:
3232
parser = argparse.ArgumentParser()
3333
parser.add_argument('filename', default='/dev/stdin')
3434
args = parser.parse_args(argv)

setup.cfg

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ classifiers =
1313
License :: OSI Approved :: MIT License
1414
Programming Language :: Python :: 3
1515
Programming Language :: Python :: 3 :: Only
16-
Programming Language :: Python :: 3.6
1716
Programming Language :: Python :: 3.7
1817
Programming Language :: Python :: 3.8
1918
Programming Language :: Python :: 3.9
@@ -26,7 +25,7 @@ py_modules = markdown_code_blocks
2625
install_requires =
2726
mistune>=2.0.0a5
2827
pygments
29-
python_requires = >=3.6.1
28+
python_requires = >=3.7
3029

3130
[options.entry_points]
3231
console_scripts =

setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
from __future__ import annotations
2+
13
from setuptools import setup
24
setup()

tests/markdown_code_blocks_test.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from markdown_code_blocks import CodeRenderer
24
from markdown_code_blocks import highlight
35
from markdown_code_blocks import main

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py36,py37,py38,pypy3,pre-commit
2+
envlist = py37,py38,pypy3,pre-commit
33

44
[testenv]
55
deps = -rrequirements-dev.txt

0 commit comments

Comments
 (0)