Skip to content

Deprecate Python 3.7. #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 12 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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: [
Expand All @@ -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: [
Expand All @@ -77,6 +77,7 @@ repos:
additional_dependencies: [
attrs>=21.3.0,
click,
pytask,
types-PyYAML,
types-setuptools
]
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- nodefaults

dependencies:
- python >= 3.7
- python >= 3.8
- pip
- setuptools_scm
- toml
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ignore_errors = true


[tool.ruff]
target-version = "py37"
target-version = "py38"
select = ["ALL"]
fix = true
extend-ignore = [
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ url = https://github.com/pytask-dev/pytask-latex
author = Tobias Raabe
author_email = [email protected]
license = MIT
license_file = LICENSE
license_files = LICENSE
platforms = any
classifiers =
Development Status :: 4 - Beta
Expand All @@ -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
Expand Down
12 changes: 7 additions & 5 deletions src/pytask_latex/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions src/pytask_latex/compilation_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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