Skip to content

Commit ec5e1d4

Browse files
authored
Deprecate Python 3.6 and add Python 3.10. (#15)
1 parent f1ee77a commit ec5e1d4

File tree

9 files changed

+33
-22
lines changed

9 files changed

+33
-22
lines changed

.github/workflows/continuous-integration-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
21-
python-version: ['3.6', '3.7', '3.8', '3.9']
21+
python-version: ['3.7', '3.8', '3.9', '3.10']
2222

2323
steps:
2424
- uses: actions/checkout@v2
@@ -50,7 +50,7 @@ jobs:
5050
run: tox -e pytest -- src tests -m "unit or (not integration and not end_to_end)" --cov=./ --cov-report=xml -n auto
5151

5252
- name: Upload coverage report for unit tests and doctests.
53-
if: runner.os == 'Linux' && matrix.python-version == '3.8'
53+
if: runner.os == 'Linux' && matrix.python-version == '3.9'
5454
shell: bash -l {0}
5555
run: bash <(curl -s https://codecov.io/bash) -F unit -c
5656

@@ -59,6 +59,6 @@ jobs:
5959
run: tox -e pytest -- src tests -m end_to_end --cov=./ --cov-report=xml -n auto
6060

6161
- name: Upload coverage reports of end-to-end tests.
62-
if: runner.os == 'Linux' && matrix.python-version == '3.8'
62+
if: runner.os == 'Linux' && matrix.python-version == '3.9'
6363
shell: bash -l {0}
6464
run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c

.pre-commit-config.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.0.1
3+
rev: v4.1.0
44
hooks:
55
- id: check-added-large-files
66
args: ['--maxkb=25']
@@ -22,24 +22,25 @@ repos:
2222
- id: rst-inline-touching-normal
2323
- id: text-unicode-replacement-char
2424
- repo: https://github.com/asottile/pyupgrade
25-
rev: v2.29.0
25+
rev: v2.31.0
2626
hooks:
2727
- id: pyupgrade
28-
args: [--py36-plus]
28+
args: [--py37-plus]
2929
- repo: https://github.com/asottile/reorder_python_imports
30-
rev: v2.6.0
30+
rev: v2.7.1
3131
hooks:
3232
- id: reorder-python-imports
33+
args: [--py37-plus, --add-import, 'from __future__ import annotations']
3334
- repo: https://github.com/asottile/setup-cfg-fmt
34-
rev: v1.19.0
35+
rev: v1.20.0
3536
hooks:
3637
- id: setup-cfg-fmt
3738
- repo: https://github.com/psf/black
38-
rev: 21.10b0
39+
rev: 22.1.0
3940
hooks:
4041
- id: black
4142
- repo: https://github.com/asottile/blacken-docs
42-
rev: v1.11.0
43+
rev: v1.12.1
4344
hooks:
4445
- id: blacken-docs
4546
additional_dependencies: [black]

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from setuptools import setup
24

35

src/latex_dependency_scanner/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""The name space for the package."""
2+
from __future__ import annotations
3+
24
from latex_dependency_scanner.compile import compile_pdf
35
from latex_dependency_scanner.scanner import scan
46

src/latex_dependency_scanner/compile.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
be used by users to compile their documents.
55
66
"""
7+
from __future__ import annotations
8+
79
import os
810
import shutil
911
import subprocess
1012
from pathlib import Path
11-
from typing import List
12-
from typing import Optional
1313

1414

1515
DEFAULT_OPTIONS = ["--pdf", "--interaction=nonstopmode", "--synctex=1", "--cd"]
1616

1717

1818
def compile_pdf(
1919
latex_document: Path,
20-
compiled_document: Optional[Path] = None,
21-
args: Optional[List[str]] = None,
20+
compiled_document: Path | None = None,
21+
args: list[str] | None = None,
2222
):
2323
"""Generate a PDF from LaTeX document."""
2424
if shutil.which("latexmk") is None:
@@ -30,8 +30,8 @@ def compile_pdf(
3030

3131
def _prepare_cmd_options(
3232
latex_document: Path,
33-
compiled_document: Optional[Path] = None,
34-
args: Optional[List[str]] = None,
33+
compiled_document: Path | None = None,
34+
args: list[str] | None = None,
3535
):
3636
"""Prepare the command line arguments to compile the LaTeX document.
3737

src/latex_dependency_scanner/scanner.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""Includes the ability to scan a LaTeX document."""
2+
from __future__ import annotations
3+
24
import re
35
from os.path import splitext
46
from pathlib import Path
5-
from typing import List
6-
from typing import Optional
7-
from typing import Union
7+
88

99
COMMON_TEX_EXTENSIONS = [".ltx", ".tex"]
1010
"""List[str]: List of typical file extensions that contain latex"""
@@ -47,7 +47,7 @@
4747
document."""
4848

4949

50-
def scan(paths: Union[Path, List[Path]]):
50+
def scan(paths: Path | list[Path]):
5151
"""Scan the documents provided as paths for included files.
5252
5353
Parameters
@@ -70,8 +70,8 @@ def scan(paths: Union[Path, List[Path]]):
7070

7171
def yield_nodes_from_node(
7272
node: Path,
73-
nodes: List[Path],
74-
relative_to: Optional[Path] = None,
73+
nodes: list[Path],
74+
relative_to: Path | None = None,
7575
):
7676
r"""Yield nodes from node.
7777

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""Configuration file for pytest."""
2+
from __future__ import annotations
3+
24
import shutil
35
from pathlib import Path
46

tests/test_regex.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""Test regular expressions."""
2+
from __future__ import annotations
3+
24
import pytest
35
from latex_dependency_scanner.scanner import REGEX_TEX
46

tests/test_scan.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import shutil
24
import textwrap
35

0 commit comments

Comments
 (0)