Skip to content

Commit

Permalink
Merge pull request #140 from asottile/all-repos_autofix_drop-py36
Browse files Browse the repository at this point in the history
drop python3.6 support
  • Loading branch information
asottile authored Jan 15, 2022
2 parents ac2382f + cfa698f commit fb39015
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ repos:
rev: v2.6.0
hooks:
- id: reorder-python-imports
args: [--py3-plus]
args: [--py37-plus, --add-import, 'from __future__ import annotations']
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py3-plus]
args: [--py37-plus]
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.1
hooks:
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ resources:
type: github
endpoint: github
name: asottile/azure-pipeline-templates
ref: refs/tags/v2.1.0
ref: refs/tags/v2.4.0

jobs:
- template: job--python-tox.yml@asottile
parameters:
toxenvs: [py36, py37]
toxenvs: [py37, py38, py39, py310]
os: linux
11 changes: 5 additions & 6 deletions blacken_docs.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from __future__ import annotations

import argparse
import contextlib
import re
import textwrap
from typing import Generator
from typing import List
from typing import Match
from typing import NamedTuple
from typing import Optional
from typing import Sequence
from typing import Tuple

import black

Expand Down Expand Up @@ -85,8 +84,8 @@ class CodeBlockError(NamedTuple):

def format_str(
src: str, black_mode: black.FileMode,
) -> Tuple[str, Sequence[CodeBlockError]]:
errors: List[CodeBlockError] = []
) -> tuple[str, Sequence[CodeBlockError]]:
errors: list[CodeBlockError] = []

@contextlib.contextmanager
def _collect_error(match: Match[str]) -> Generator[None, None, None]:
Expand Down Expand Up @@ -214,7 +213,7 @@ def format_file(
return 0


def main(argv: Optional[Sequence[str]] = None) -> int:
def main(argv: Sequence[str] | None = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument(
'-l', '--line-length', type=int, default=black.DEFAULT_LINE_LENGTH,
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ classifiers =
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: Implementation :: CPython
Expand All @@ -23,7 +22,7 @@ classifiers =
py_modules = blacken_docs
install_requires =
black>=19.3b0
python_requires = >=3.6.1
python_requires = >=3.7

[options.entry_points]
console_scripts =
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from __future__ import annotations

from setuptools import setup
setup()
2 changes: 2 additions & 0 deletions tests/blacken_docs_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import black

import blacken_docs
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py37,pre-commit
envlist = py37,pre-commit

[testenv]
deps = -rrequirements-dev.txt
Expand Down

0 comments on commit fb39015

Please sign in to comment.