Skip to content

Commit 6aec6e8

Browse files
Release v0.4.0. (#60)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 331ef87 commit 6aec6e8

18 files changed

+304
-411
lines changed

.github/workflows/main.yml

+7-11
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,18 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
30-
python-version: ['3.8', '3.9', '3.10', '3.11']
30+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
3131

3232
steps:
3333
- uses: actions/checkout@v4
3434
- uses: r-lib/actions/setup-tinytex@v2
3535
if: runner.os != 'Windows'
36-
- uses: conda-incubator/setup-miniconda@v2
36+
- uses: actions/setup-python@v4
3737
with:
38-
auto-update-conda: false
3938
python-version: ${{ matrix.python-version }}
40-
channels: conda-forge,nodefaults
41-
miniforge-variant: Mambaforge
42-
43-
- name: Install core dependencies.
44-
shell: bash -l {0}
45-
run: mamba install -c conda-forge tox-conda coverage
39+
cache: pip
40+
allow-prereleases: true
41+
- run: pip install tox
4642

4743
# Unit, integration, and end-to-end tests.
4844

@@ -51,7 +47,7 @@ jobs:
5147
run: tox -e pytest -- -m "unit or (not integration and not end_to_end)" --cov=./ --cov-report=xml -n auto
5248

5349
- name: Upload coverage report for unit tests and doctests.
54-
if: runner.os == 'Linux' && matrix.python-version == '3.8'
50+
if: runner.os == 'Linux' && matrix.python-version == '3.10'
5551
shell: bash -l {0}
5652
run: bash <(curl -s https://codecov.io/bash) -F unit -c
5753

@@ -60,6 +56,6 @@ jobs:
6056
run: tox -e pytest -- -m end_to_end --cov=./ --cov-report=xml -n auto
6157

6258
- name: Upload coverage reports of end-to-end tests.
63-
if: runner.os == 'Linux' && matrix.python-version == '3.8'
59+
if: runner.os == 'Linux' && matrix.python-version == '3.10'
6460
shell: bash -l {0}
6561
run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c

.pre-commit-config.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,10 @@ repos:
7070
rev: 'v1.5.1'
7171
hooks:
7272
- id: mypy
73-
args: [
74-
--no-strict-optional,
75-
--ignore-missing-imports,
76-
]
7773
additional_dependencies: [
7874
attrs>=21.3.0,
7975
click,
80-
pytask,
76+
pytask>=0.4.0,
8177
types-PyYAML,
8278
types-setuptools
8379
]

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This is a record of all past pytask-latex releases and what went into them in re
44
chronological order. Releases follow [semantic versioning](https://semver.org/) and all
55
releases are available on [Anaconda.org](https://anaconda.org/conda-forge/pytask-latex).
66

7+
## 0.4.0 - 2023-10-07
8+
9+
- {pull}`60` updates the package to use pytask v0.4.0.
10+
711
## 0.3.0 - 2022-12-xx
812

913
- {pull}`49` removes support for INI configurations.

README.md

+30-15
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ popular LaTeX distributions, like [TeX Live](https://www.tug.org/texlive/),
5050
Compiling your PDF can be as simple as writing the following task.
5151

5252
```python
53+
from pathlib import Path
5354
import pytask
5455

5556

56-
@pytask.mark.latex(script="document.tex", document="document.pdf")
57+
@pytask.mark.latex(script=Path("document.tex"), document=Path("document.pdf"))
5758
def task_compile_latex_document():
5859
pass
5960
```
@@ -64,11 +65,24 @@ task module to the LaTeX file and the compiled document.
6465

6566
### Dependencies and Products
6667

67-
Dependencies and products can be added as with a normal pytask task using the
68-
`@pytask.mark.depends_on` and `@pytask.mark.produces` decorators. which is explained in
69-
this
68+
Dependencies and products can be added as usual. Read this
7069
[tutorial](https://pytask-dev.readthedocs.io/en/stable/tutorials/defining_dependencies_products.html).
7170

71+
For example, with the `@pytask.task` decorator. (The choice of the kwarg name, here
72+
`path`, is arbitrary.)
73+
74+
```python
75+
import pytask
76+
from pytask import task
77+
from pathlib import Path
78+
79+
80+
@task(kwargs={"path": Path("path_to_another_dependency.tex")})
81+
@pytask.mark.latex(script=Path("document.tex"), document=Path("document.pdf"))
82+
def task_compile_latex_document():
83+
pass
84+
```
85+
7286
### Customizing the compilation
7387

7488
pytask-latex uses latexmk by default to compile the document because it handles most
@@ -77,8 +91,8 @@ decorator.
7791

7892
```python
7993
@pytask.mark.latex(
80-
script="document.tex",
81-
document="document.pdf",
94+
script=Path("document.tex"),
95+
document=Path("document.pdf"),
8296
compilation_steps="latexmk",
8397
)
8498
def task_compile_latex_document():
@@ -95,8 +109,8 @@ from pytask_latex import compilation_steps as cs
95109

96110

97111
@pytask.mark.latex(
98-
script="document.tex",
99-
document="document.pdf",
112+
script=Path("document.tex"),
113+
document=Path("document.pdf"),
100114
compilation_steps=cs.latexmk(
101115
options=("--pdf", "--interaction=nonstopmode", "--synctex=1", "--cd")
102116
),
@@ -113,8 +127,8 @@ an example for generating a `.dvi`.
113127

114128
```python
115129
@pytask.mark.latex(
116-
script="document.tex",
117-
document="document.pdf",
130+
script=Path("document.tex"),
131+
document=Path("document.pdf"),
118132
compilation_steps=cs.latexmk(
119133
options=("--dvi", "--interaction=nonstopmode", "--synctex=1", "--cd")
120134
),
@@ -157,23 +171,24 @@ The following task compiles two latex documents.
157171
for i in range(2):
158172

159173
@pytask.mark.task
160-
@pytask.mark.latex(script=f"document_{i}.tex", document=f"document_{i}.pdf")
174+
@pytask.mark.latex(
175+
script=Path(f"document_{i}.tex"), document=Path(f"document_{i}.pdf")
176+
)
161177
def task_compile_latex_document():
162178
pass
163179
```
164180

165181
If you want to compile the same document with different command line options, you have
166-
to include the latex decorator in the parametrization just like with
167-
`@pytask.mark.depends_on` and `@pytask.mark.produces`. Pass a dictionary for possible
182+
to include the latex decorator in the parametrization. Pass a dictionary for possible
168183
compilation steps and their options.
169184

170185
```python
171186
for format_ in ("pdf", "dvi"):
172187

173188
@pytask.mark.task
174189
@pytask.mark.latex(
175-
script="document.tex",
176-
document=f"document.{format_}",
190+
script=Path("document.tex"),
191+
document=Path(f"document.{format_}"),
177192
compilation_steps=cs.latexmk(
178193
(f"--{format_}", "--interaction=nonstopmode", "--synctex=1", "--cd")
179194
),

environment.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: pytask-latex
22

33
channels:
4+
- conda-forge/label/pytask_rc
5+
- conda-forge/label/pytask_parallel_rc
46
- conda-forge
57
- nodefaults
68

@@ -11,10 +13,9 @@ dependencies:
1113
- toml
1214

1315
# Package dependencies
14-
- pytask >= 0.3
15-
- pytask-parallel >= 0.3
16+
- pytask >= 0.4.0
17+
- pytask-parallel >= 0.4.0
1618
- latex-dependency-scanner >=0.1.1
17-
- pybaum >=0.1.1
1819

1920
# Misc
2021
- black

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ convention = "numpy"
6767

6868
[tool.pytest.ini_options]
6969
# Do not add src since it messes with the loading of pytask-parallel as a plugin.
70-
testpaths = ["test"]
70+
testpaths = ["tests"]
7171
markers = [
7272
"wip: Tests that are work-in-progress.",
7373
"unit: Flag for unit tests which target mainly a single function.",

setup.cfg

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ project_urls =
2424
[options]
2525
packages = find:
2626
install_requires =
27-
click
2827
latex-dependency-scanner>=0.1.1
29-
pybaum>=0.1.1
30-
pytask>=0.3
28+
pluggy>=1.0.0
29+
pytask>=0.4.0
3130
python_requires = >=3.8
3231
include_package_data = True
3332
package_dir = =src

0 commit comments

Comments
 (0)