Commit c7d41c8
committed
♻️ Integrate
Fold the `aiida-shell` package into core. Entry-point names are carried
over verbatim, and node type strings are derived from those names rather
than from module paths, so nodes written by `aiida-shell` keep loading
unchanged.
Source:
calculations/shell.py -> aiida/calculations/shell.py
parsers/shell.py -> aiida/parsers/plugins/shell.py
data/pickled.py -> aiida/orm/nodes/data/pickled.py
data/entry_point.py -> aiida/orm/nodes/data/entry_point.py
data/code.py -> aiida/orm/nodes/data/code/shell.py
launch.py -> aiida/engine/launch.py
LICENSE.txt -> open_source_licenses.txt
Tests, mirroring where the code landed:
calculations/test_shell.py -> tests/calculations/test_shell.py
parsers/test_shell.py -> tests/parsers/test_shell.py
data/test_pickled.py -> tests/orm/data/test_pickled.py
data/test_entry_point.py -> tests/orm/data/test_entry_point.py
data/test_code.py -> tests/orm/data/code/test_shell.py
test_launch.py -> tests/engine/test_launch_shell_job.py
The package markers, `py.typed` and `__version__` are dropped, as are
`test_version.py`, the documentation, CI workflows and repository
configuration.
The package's `conftest.py` is dissolved onto core's fixtures. Its
`aiida_profile` override goes: core's own fixture already provides a
broker and honours `--db-backend` and `--broker-backend`, both of which
the override ignored, so the CI job running on ZeroMQ without a
RabbitMQ service would have failed. `generate_computer` and
`generate_code` become `aiida_computer_local`, `aiida_localhost` and
`aiida_code_installed`. What is genuinely specific to these tests stays
as `generate_shell_code` and `generate_shell_calc_job` in
`tests/calculations/conftest.py`, and the parser helpers in
`tests/parsers/conftest.py`. `generate_shell_calc_job` keeps a name of
its own because core's `generate_calc_job` has a different signature
and is used by four other modules in the same directory.
Six edits go beyond a verbatim copy of the source, each forced by the
destination:
- `launch_shell_job` imports `ShellJob` inside the function body.
`aiida.calculations.shell` imports `aiida.engine`, so importing it at
module level from `aiida/engine/launch.py` is a cycle.
- The module-level `submit` is aliased as `_submit_process`, because
`launch_shell_job` takes a boolean `submit` argument shadowing it.
- `ShellJob` and `ShellParser` no longer declare `__all__`, as no other
core calculation job or parser does; both are reached through their
entry points.
- The `nodes` argument of `process_arguments_and_nodes` and
`prepare_filenames` is annotated `Data`, not `SinglefileData`, which
is what the port declares. The narrower annotation left the
`FolderData` and `RemoteData` branches unreachable.
- `prepare_filenames` returns `dict[str, str | None]`, which is what it
always built and what `write_folder_data` already accepted.
- Imports of sibling data modules are absolute, `t.Union` becomes `|`,
and one unused unpacked variable is prefixed, for rules core enables
and `aiida-shell` did not.
- Exception messages are assigned to `msg` before being raised, as core
does and `aiida-shell` did not. Three defensive guards keep the inline
form: mypy proves them unreachable and tolerates a bare `raise` there,
but not the assignment in front of it.
`dill` becomes a runtime dependency, exempt from import checking since
it ships no type information, and floored at 0.3.6. `PickledData`
pickles with `recurse=True`, which arrived in 0.3.0, but only 0.3.6
round-trips what it writes; the requirement came over unpinned, so the
minimum-requirements job resolved `dill==0.2`.
Landing the data plugins in core also brings them into sweeps that walk
every registered node type. `test_all_node_fields` keeps a regression
file per type, and `test_data_exporters` needs a way to build a dummy
instance of anything carrying `_prepare_*` methods, which `ShellCode`
inherits from `InstalledCode`.
Two smaller consequences. The ported `launch_shell_job` tests delete the
computer they create in a `finally` and assert on the log record's
level rather than its position, since the computer is labelled
`localhost` and leaking it breaks every later test in the worker that
wants `aiida_localhost`. And `verdi devel` no longer describes the
localhost it creates as made by `aiida.engine.launch_shell_job`, a
string copied out of `aiida-shell` years ago that named nothing until
this commit, and now names a function that did not create it.aiida-shell into core (aiidateam#7600)1 parent 6b3d982 commit c7d41c8
29 files changed
Lines changed: 3046 additions & 5 deletions
File tree
- src/aiida
- calculations
- cmdline/commands
- engine
- orm
- nodes
- data
- code
- parsers/plugins
- tests
- calculations
- test_shell
- engine
- orm
- data
- code
- nodes/data
- test_fields
- parsers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
| |||
286 | 292 | | |
287 | 293 | | |
288 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| 122 | + | |
120 | 123 | | |
121 | 124 | | |
| 125 | + | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
| |||
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| 134 | + | |
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
| |||
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
| 174 | + | |
169 | 175 | | |
170 | 176 | | |
171 | 177 | | |
| |||
401 | 407 | | |
402 | 408 | | |
403 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
404 | 426 | | |
405 | 427 | | |
406 | 428 | | |
| |||
411 | 433 | | |
412 | 434 | | |
413 | 435 | | |
| 436 | + | |
414 | 437 | | |
415 | 438 | | |
416 | 439 | | |
| |||
0 commit comments