diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b62796..2ffdef4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6c9b3e..91b2073 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,25 +25,25 @@ repos: - id: python-no-log-warn - id: python-use-type-annotations - id: text-unicode-replacement-char -- repo: https://github.com/asottile/reorder_python_imports - rev: v3.9.0 +- repo: https://github.com/asottile/reorder-python-imports + rev: v3.11.0 hooks: - id: reorder-python-imports - args: [--py37-plus, --add-import, 'from __future__ import annotations'] + args: [--py38-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.2.0 + rev: v2.4.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.9.1 hooks: - id: black -- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.261 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.291 hooks: - id: ruff - repo: https://github.com/dosisod/refurb - rev: v1.15.0 + rev: v1.21.0 hooks: - id: refurb args: [--ignore, FURB126] @@ -53,7 +53,7 @@ repos: - id: interrogate args: [-v, --fail-under=40, src, tests] - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 + rev: 0.7.17 hooks: - id: mdformat additional_dependencies: [ @@ -62,12 +62,12 @@ repos: ] args: [--wrap, "88"] - repo: https://github.com/codespell-project/codespell - rev: v2.2.4 + rev: v2.2.5 hooks: - id: codespell args: [-L als, -L falsy] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.2.0' + rev: 'v1.5.1' hooks: - id: mypy args: [ @@ -77,6 +77,7 @@ repos: additional_dependencies: [ attrs>=21.3.0, click, + pytask, types-PyYAML, types-setuptools ] diff --git a/environment.yml b/environment.yml index f93b275..d747ffd 100644 --- a/environment.yml +++ b/environment.yml @@ -5,7 +5,7 @@ channels: - nodefaults dependencies: - - python >= 3.7 + - python >= 3.8 - pip - setuptools_scm - toml diff --git a/pyproject.toml b/pyproject.toml index 05d3c0d..ec866d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ ignore_errors = true [tool.ruff] -target-version = "py37" +target-version = "py38" select = ["ALL"] fix = true extend-ignore = [ diff --git a/setup.cfg b/setup.cfg index 063d8b5..56aadba 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,7 +7,7 @@ url = https://github.com/pytask-dev/pytask-latex author = Tobias Raabe author_email = raabe@posteo.de license = MIT -license_file = LICENSE +license_files = LICENSE platforms = any classifiers = Development Status :: 4 - Beta @@ -28,7 +28,7 @@ install_requires = latex-dependency-scanner>=0.1.1 pybaum>=0.1.1 pytask>=0.3 -python_requires = >=3.7 +python_requires = >=3.8 include_package_data = True package_dir = =src zip_safe = False diff --git a/src/pytask_latex/collect.py b/src/pytask_latex/collect.py index be2d52f..3819a18 100644 --- a/src/pytask_latex/collect.py +++ b/src/pytask_latex/collect.py @@ -65,11 +65,11 @@ def compile_latex_document( Replaces the placeholder function provided by the user. """ - for step in compilation_steps: - try: + try: + for step in compilation_steps: step(path_to_tex=path_to_tex, path_to_document=path_to_document) - except CalledProcessError as e: - raise RuntimeError(f"Compilation step {step.__name__} failed.") from e + except CalledProcessError as e: + raise RuntimeError(f"Compilation step {step.__name__} failed.") from e @hookimpl @@ -182,7 +182,9 @@ def _add_latex_dependencies_retroactively(task: Task, session: Session) -> Task: """ # Scan the LaTeX document for included files. - latex_dependencies = set(lds.scan(task.depends_on["__script"].path)) + latex_dependencies = set( + lds.scan(task.depends_on["__script"].path) # type: ignore[attr-defined] + ) # Remove duplicated dependencies which have already been added by the user and those # which do not exist. diff --git a/src/pytask_latex/compilation_steps.py b/src/pytask_latex/compilation_steps.py index e7f787a..944731c 100644 --- a/src/pytask_latex/compilation_steps.py +++ b/src/pytask_latex/compilation_steps.py @@ -34,9 +34,7 @@ def run_latexmk(path_to_tex: Path, path_to_document: Path) -> None: out_dir_opt = [ f"--output-directory={relative_to(path_to_tex, path_to_document.parent)}" ] - cmd = ["latexmk", *options, *job_name_opt, *out_dir_opt] + [ - path_to_tex.as_posix() - ] - subprocess.run(cmd, check=True) + cmd = ["latexmk", *options, *job_name_opt, *out_dir_opt, path_to_tex.as_posix()] + subprocess.run(cmd, check=True) # noqa: S603 return run_latexmk