Skip to content

Commit

Permalink
Drop Python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Oct 9, 2022
1 parent b7b83e5 commit 2decfd5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ jobs:
matrix:
include:
- python: '^3.10'
os: ubuntu-latest
- python: '3.10'
os: macos-latest
- python: 3.9
- python: '3.10'
os: windows-latest
- python: 3.8
- python: 3.9
os: ubuntu-latest
- python: 3.7
- python: 3.8
os: macos-latest
- python: 3.6
- python: 3.7
os: windows-latest
- python: 3.6
- python: 3.7
os: ubuntu-latest
versions: minimal
runs-on: ${{matrix.os}}
Expand Down
4 changes: 2 additions & 2 deletions mkdocs_section_index/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Union
from __future__ import annotations

from mkdocs.config import Config
from mkdocs.structure.files import File
Expand All @@ -10,7 +10,7 @@

class SectionPage(Section, Page): # type: ignore[misc]
def __init__(
self, title: str, file: File, config: Config, children: List[Union[Page, Section, Link]]
self, title: str, file: File, config: Config, children: list[Page | Section | Link]
):
Page.__init__(self, title=title, file=file, config=config)
Section.__init__(self, title=title, children=children)
Expand Down
2 changes: 2 additions & 0 deletions mkdocs_section_index/plugin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import collections
import logging

Expand Down
12 changes: 7 additions & 5 deletions mkdocs_section_index/rewrites.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from __future__ import annotations

import logging
import pathlib
import textwrap
from typing import Callable, Optional, Tuple
from typing import Callable

import mkdocs.utils
from jinja2 import BaseLoader, Environment
Expand All @@ -20,8 +22,8 @@ def __init__(self, loader: BaseLoader):

def get_source(
self, environment: Environment, template: str
) -> Tuple[str, str, Optional[Callable[[], bool]]]:
src: Optional[str]
) -> tuple[str, str, Callable[[], bool] | None]:
src: str | None
src, filename, uptodate = self.loader.get_source(environment, template)
old_src = src
assert filename is not None
Expand All @@ -48,7 +50,7 @@ def get_source(
return src or old_src, filename, uptodate


def _transform_mkdocs_sitemap_template(src: str) -> Optional[str]:
def _transform_mkdocs_sitemap_template(src: str) -> str | None:
if " in pages " not in src:
# The below only for versions <= 1.1.2.
return src.replace(
Expand Down Expand Up @@ -124,7 +126,7 @@ def _transform_readthedocs_base_template(src: str) -> str:
return "\n".join(lines)


def _replace_line(line: str, wrapper: str, new_line: Optional[str] = None) -> str:
def _replace_line(line: str, wrapper: str, new_line: str | None = None) -> str:
leading_space = line[: -len(line.lstrip())]
if new_line is None:
new_line = line.lstrip()
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ readme = "README.md"
section-index = "mkdocs_section_index.plugin:SectionIndexPlugin"

[tool.poetry.dependencies]
python = "^3.6"
python = "^3.7"
mkdocs = "^1.1"
dataclasses = {version = ">=0.7, <1.0", python = "<3.7"}

Expand All @@ -24,7 +24,7 @@ MechanicalSoup = ">=0.12.0, <1.0"
black = ">=20.8b1"
isort = "^5.6.4"
autoflake = "^1.4"
pytype = {version = ">=2021.04.15", markers = "python_version>='3.6' and python_version<'3.10' and sys_platform!='win32'"} # Skip on Windows
pytype = {version = ">=2021.04.15", markers = "python_version>='3.7' and python_version<'3.10' and sys_platform!='win32'"} # Skip on Windows
mkdocs-material = ">=6.1.5"

[tool.black]
Expand Down

0 comments on commit 2decfd5

Please sign in to comment.