Skip to content

Commit 2b15b07

Browse files
committed
Most tests working.
1 parent fbc6bb5 commit 2b15b07

18 files changed

+179
-242
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22

33
name: Bug Report
4-
about: Create a bug report to help us improve pytask-xxxxx
4+
about: Create a bug report to help us improve pytask-julia
55
title: "BUG:"
66
labels: "bug"
77

88
---
99

1010
- [ ] I have checked that this issue has not already been reported.
1111

12-
- [ ] I have confirmed this bug exists on the latest version of pytask-xxxxx.
12+
- [ ] I have confirmed this bug exists on the latest version of pytask-julia.
1313

1414
- [ ] (optional) I have confirmed this bug exists on the `main` branch of
15-
pytask-xxxxx.
15+
pytask-julia.
1616

1717
---
1818

.github/ISSUE_TEMPLATE/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ labels: "documentation"
1212
Provide the location of the documentation, e.g. an URL of the documentation.
1313

1414
**Note**: You can check the latest versions of the docs on `main`
15-
[here](https://pytask-xxxxx.readthedocs.io/en/latest).
15+
[here](https://pytask-julia.readthedocs.io/en/latest).
1616

1717
#### Documentation problem
1818

.github/ISSUE_TEMPLATE/enhancement.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22

33
name: Enhancement
4-
about: Suggest an idea for pytask-xxxxx
4+
about: Suggest an idea for pytask-julia
55
title: "ENH:"
66
labels: "enhancement"
77

88
---
99

1010
#### Is your feature request related to a problem?
1111

12-
Provide a description of what the problem is, e.g. "I wish I could use pytask-xxxxx
12+
Provide a description of what the problem is, e.g. "I wish I could use pytask-julia
1313
to do [...]".
1414

1515
#### Describe the solution you'd like

.github/ISSUE_TEMPLATE/question.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22

33
name: Submit Question
4-
about: Ask a general question about pytask-xxxxx
4+
about: Ask a general question about pytask-script.jl
55
title: "QST:"
66
labels: "question"
77

88
---
99

10-
#### Question about pytask-xxxxx
10+
#### Question about pytask-script.jl
1111

1212
**Note**: If you'd still like to submit a question, please read [this guide](
1313
https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to

.github/workflows/main.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,18 @@ jobs:
1111

1212
run-tests:
1313

14-
name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }} and ${{ matrix.xxxxx-version }}
14+
name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }} and ${{ matrix.julia-version }}
1515
runs-on: ${{ matrix.os }}
1616

1717
strategy:
1818
fail-fast: false
1919
matrix:
2020
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
2121
python-version: ['3.7', '3.8', '3.9']
22-
xxxxx-version: ['main_version']
22+
julia-version: ['main_version']
2323

2424
steps:
2525
- uses: actions/checkout@v2
26-
- uses: xxxxx-lib/actions/setup-r@v1
27-
with:
28-
r-version: ${{ matrix.xxxxx-version }}
2926
- uses: conda-incubator/setup-miniconda@v2
3027
with:
3128
auto-update-conda: true
@@ -42,7 +39,7 @@ jobs:
4239
run: tox -e pytest -- -m "unit or (not integration and not end_to_end)" --cov=./ --cov-report=xml -n auto
4340

4441
- name: Upload coverage report for unit tests and doctests.
45-
if: runner.os == 'Linux' && matrix.python-version == '3.8' && matrix.xxxxx-version == 'main_version'
42+
if: runner.os == 'Linux' && matrix.python-version == '3.8' && matrix.julia-version == 'main_version'
4643
shell: bash -l {0}
4744
run: bash <(curl -s https://codecov.io/bash) -F unit -c
4845

@@ -51,11 +48,11 @@ jobs:
5148
run: tox -e pytest -- -m end_to_end --cov=./ --cov-report=xml -n auto
5249

5350
- name: Upload coverage reports of end-to-end tests.
54-
if: runner.os == 'Linux' && matrix.python-version == '3.8' && matrix.xxxxx-version == 'main_version'
51+
if: runner.os == 'Linux' && matrix.python-version == '3.8' && matrix.julia-version == 'main_version'
5552
shell: bash -l {0}
5653
run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c
5754

5855
- name: Validate codecov.yml
59-
if: runner.os == 'Linux' && matrix.python-version == '3.8' && matrix.xxxxx-version == 'main_version'
56+
if: runner.os == 'Linux' && matrix.python-version == '3.8' && matrix.julia-version == 'main_version'
6057
shell: bash -l {0}
6158
run: cat codecov.yml | curl --data-binary @- https://codecov.io/validate

README.rst

Lines changed: 45 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
# Template for pytask plugins
2-
3-
This template has been generated by comparing the R and Stata plugins. It is thus based on the assumption that anything which is common between those two plugins is likely to be the same in the new plugin as well.
4-
5-
Usage:
6-
- Download the source code
7-
- Rename the folder `src/pytask_xxxxx` to `src/pytask_[your plugin's identifier]`
8-
- Open this entire source code in an editor.
9-
- Do project wide search (S) and replace for:
10-
11-
- **S**: YYYYY, **R**: [Your language's verbose name, e.g. R, Stata, Julia]
12-
- **S**: ZZZZZ, **R**: [The command to start your program, e.g. RScript] *(if not common across platforms or more complicated, see the Stata plugin for more involved handling)*
13-
- **S**: pytask-xxxxx, **R**: pytask-[your plugin's identifier]
14-
- **S**: pytask_xxxxx, **R**: pytask_[your plugin's identifier]
15-
- **S**: xxxxx, **R** on a case-by-case basis. This will often be your plugin's identifier, but can also be the extension of scripts in your language (e.g., `r`, `do`, `jl`) or other things.
16-
17-
- Try out
18-
- Likely the first necessary adjustments will be to the code in collect.py
19-
- For sure, later adjustments will be necessary for
20-
- the code snippets in the tests and README.rst
21-
- the author name and e-mail in `setup.cfg`
22-
- Please let us know any things you think are worth noting!
23-
24-
------
25-
261
pytask-julia
272
============
283

@@ -71,106 +46,106 @@ pytask-julia is available on `PyPI <https://pypi.org/project/pytask-julia>`_ and
7146
7247
$ conda install -c conda-forge pytask-julia
7348
74-
You also need to have YYYYY installed and ``ZZZZZ`` on your command line. Test it by
49+
You also need to have Julia installed and ``julia`` on your command line. Test it by
7550
typing the following on the command line
7651

7752
.. code-block:: console
7853
79-
$ ZZZZZ --help
54+
$ julia -h
8055
81-
If an error is shown instead of a help page, you can install YYYYY ....
56+
If an error is shown instead of a help page, you can install Julia ....
8257

8358

8459
Usage
8560
-----
8661

8762
Similarly to normal task functions which execute Python code, you define tasks to
88-
execute scripts written in YYYYY with Python functions. The difference is that the
63+
execute scripts written in Julia with Python functions. The difference is that the
8964
function body does not contain any logic, but the decorator tells pytask how to handle
9065
the task.
9166

92-
Here is an example where you want to run ``script.xxxxx``.
67+
Here is an example where you want to run ``script.julia``.
9368

9469
.. code-block:: python
9570
9671
import pytask
9772
9873
99-
@pytask.mark.xxxxx
100-
@pytask.mark.depends_on("script.xxxxxx")
74+
@pytask.mark.julia
75+
@pytask.mark.depends_on("script.jl")
10176
@pytask.mark.produces("out.csv")
102-
def task_run_xxxxx_script():
77+
def task_run_jl_script():
10378
pass
10479
105-
Note that, you need to apply the ``@pytask.mark.xxxxx`` marker so that pytask-xxxxx handles the
80+
Note that, you need to apply the ``@pytask.mark.julia`` marker so that pytask-julia handles the
10681
task.
10782

108-
If you are wondering why the function body is empty, know that pytask-xxxxx replaces the
83+
If you are wondering why the function body is empty, know that pytask-julia replaces the
10984
body with a predefined internal function. See the section on implementation details for
11085
more information.
11186

11287

11388
Multiple dependencies and products
11489
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11590

116-
What happens if a task has more dependencies? Using a list, the YYYYY script which should be
91+
What happens if a task has more dependencies? Using a list, the Julia script which should be
11792
executed must be found in the first position of the list.
11893

11994
.. code-block:: python
12095
121-
@pytask.mark.xxxxx
122-
@pytask.mark.depends_on(["script.xxxxx", "input.csv"])
96+
@pytask.mark.julia
97+
@pytask.mark.depends_on(["script.jl", "input.csv"])
12398
@pytask.mark.produces("out.csv")
124-
def task_run_xxxxx_script():
99+
def task_run_jl_script():
125100
pass
126101
127-
If you use a dictionary to pass dependencies to the task, pytask-xxxxx will, first, look
102+
If you use a dictionary to pass dependencies to the task, pytask-julia will, first, look
128103
for a ``"source"`` key in the dictionary and, secondly, under the key ``0``.
129104

130105
.. code-block:: python
131106
132-
@pytask.mark.xxxxx
133-
@pytask.mark.depends_on({"source": "script.xxxxx", "input": "input.csv"})
134-
def task_run_xxxxx_script():
107+
@pytask.mark.julia
108+
@pytask.mark.depends_on({"source": "script.jl", "input": "input.csv"})
109+
def task_run_jl_script():
135110
pass
136111
137112
138113
# or
139114
140115
141-
@pytask.mark.xxxxx
142-
@pytask.mark.depends_on({0: "script.xxxxx", "input": "input.csv"})
143-
def task_run_xxxxx_script():
116+
@pytask.mark.julia
117+
@pytask.mark.depends_on({0: "script.jl", "input": "input.csv"})
118+
def task_run_jl_script():
144119
pass
145120
146121
147122
# or two decorators for the function, if you do not assign a name to the input.
148123
149124
150-
@pytask.mark.xxxxx
151-
@pytask.mark.depends_on({"source": "script.xxxxx"})
125+
@pytask.mark.julia
126+
@pytask.mark.depends_on({"source": "script.jl"})
152127
@pytask.mark.depends_on("input.csv")
153-
def task_run_xxxxx_script():
128+
def task_run_jl_script():
154129
pass
155130
156131
157132
Command Line Arguments
158133
~~~~~~~~~~~~~~~~~~~~~~
159134

160-
The decorator can be used to pass command line arguments to ``ZZZZZ``. See the
135+
The decorator can be used to pass command line arguments to ``julia``. See the
161136
following example.
162137

163138
.. code-block:: python
164139
165-
@pytask.mark.xxxxx("value")
166-
@pytask.mark.depends_on("script.xxxxx")
140+
@pytask.mark.julia("value")
141+
@pytask.mark.depends_on("script.jl")
167142
@pytask.mark.produces("out.csv")
168-
def task_run_xxxxx_script():
143+
def task_run_jl_script():
169144
pass
170145
171-
And in your ``script.xxxxx``, you can intercept the value with
146+
And in your ``script.jl``, you can intercept the value with
172147

173-
.. code-block:: YYYYY
148+
.. code-block:: Julia
174149
175150
FIXME FOR YOUR LANGUAGE
176151
args <- commandArgs(trailingOnly=TRUE)
@@ -180,22 +155,22 @@ And in your ``script.xxxxx``, you can intercept the value with
180155
Parametrization
181156
~~~~~~~~~~~~~~~
182157

183-
You can also parametrize the execution of scripts, meaning executing multiple YYYYY scripts
184-
as well as passing different command line arguments to the same YYYYY script.
158+
You can also parametrize the execution of scripts, meaning executing multiple Julia scripts
159+
as well as passing different command line arguments to the same Julia script.
185160

186-
The following task executes two YYYYY scripts which produce different outputs.
161+
The following task executes two Julia scripts which produce different outputs.
187162

188163
.. code-block:: python
189164
190165
from src.config import BLD, SRC
191166
192167
193-
@pytask.mark.xxxxx
168+
@pytask.mark.julia
194169
@pytask.mark.parametrize(
195170
"depends_on, produces",
196-
[(SRC / "script_1.xxxxx", BLD / "1.csv"), (SRC / "script_2.xxxxx", BLD / "2.csv")],
171+
[(SRC / "script_1.jl", BLD / "1.csv"), (SRC / "script_2.jl", BLD / "2.csv")],
197172
)
198-
def task_execute_xxxxx_script():
173+
def task_execute_julia_script():
199174
pass
200175
201176
And the R script includes something like
@@ -205,30 +180,30 @@ And the R script includes something like
205180
args <- commandArgs(trailingOnly=TRUE)
206181
produces <- args[1] # holds the path
207182
208-
If you want to pass different command line arguments to the same YYYYY script, you have to
209-
include the ``@pytask.mark.xxxxx`` decorator in the parametrization just like with
183+
If you want to pass different command line arguments to the same Julia script, you have to
184+
include the ``@pytask.mark.julia`` decorator in the parametrization just like with
210185
``@pytask.mark.depends_on`` and ``@pytask.mark.produces``.
211186

212187
.. code-block:: python
213188
214-
@pytask.mark.depends_on("script.xxxxx")
189+
@pytask.mark.depends_on("script.jl")
215190
@pytask.mark.parametrize(
216-
"produces, xxxxx",
191+
"produces, julia",
217192
[(BLD / "output_1.csv", "1"), (BLD / "output_2.csv", "2")],
218193
)
219-
def task_execute_xxxxx_script():
194+
def task_execute_julia_script():
220195
pass
221196
222197
223198
Configuration
224199
-------------
225200

226-
If you want to change the name of the key which identifies the YYYYY script, change the
201+
If you want to change the name of the key which identifies the Julia script, change the
227202
following default configuration in your pytask configuration file.
228203

229204
.. code-block:: ini
230205
231-
xxxxx_source_key = source
206+
julia_source_key = source
232207
233208
234209
Implementation Details
@@ -240,12 +215,12 @@ The plugin is a convenient wrapper around
240215
241216
import subprocess
242217
243-
subprocess.run(["ZZZZZ", "script.xxxxx"], check=True)
218+
subprocess.run(["julia", "script.jl"], check=True)
244219
245220
to which you can always resort to when the plugin does not deliver functionality you
246221
need.
247222

248-
It is not possible to enter a post-mortem debugger when an error happens in the YYYYY script
223+
It is not possible to enter a post-mortem debugger when an error happens in the Julia script
249224
or enter the debugger when starting the script. If there exists a solution for that,
250225
hints as well as contributions are highly appreciated.
251226

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ channels:
55
- nodefaults
66

77
dependencies:
8+
- julia
89
- python
910
- pip
1011
- setuptools_scm

0 commit comments

Comments
 (0)