Skip to content

Commit bea2f61

Browse files
committed
♻️ Reimplementation of Shell
xtl.jobs.shells - Reimplementation of xtl.automate.shells.Shell as frozen dataclass singleton instances - New Shell enum for tabulating available shells, comparison and initialization directly from the members docs/xtl.jobs.shells.rst - API documentation for shells.py
1 parent 28de4df commit bea2f61

File tree

8 files changed

+414
-7
lines changed

8 files changed

+414
-7
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
``xtl.jobs.batchfiles`` module
2+
==============================
3+
4+
.. automodule:: xtl.jobs.batchfiles
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/api/xtl.jobs.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
``xtl.jobs`` package
2+
====================
3+
4+
Module contents
5+
---------------
6+
7+
.. automodule:: xtl.jobs
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
Submodules
13+
----------
14+
15+
.. toctree::
16+
:maxdepth: 3
17+
18+
xtl.jobs.shells
19+
xtl.jobs.batchfiles
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
``xtl.jobs.shells`` module
2+
==========================
3+
4+
.. automodule:: xtl.jobs.shells
5+
:no-members:
6+
7+
Contents
8+
--------
9+
10+
.. autoclass:: xtl.jobs.shells.Shell
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
:exclude-members: __new__
15+
16+
.. autoclass:: xtl.jobs.shells.BaseShell
17+
:members:
18+
:undoc-members:
19+
:show-inheritance:
20+
:exclude-members: __init__, __new__
21+
22+
.. autoclass:: xtl.jobs.shells.BashShell
23+
:members:
24+
:undoc-members:
25+
:show-inheritance:
26+
:exclude-members: __init__
27+
28+
.. autoclass:: xtl.jobs.shells.CmdShell
29+
:members:
30+
:undoc-members:
31+
:show-inheritance:
32+
:exclude-members: __init__
33+
34+
.. autoclass:: xtl.jobs.shells.PowerShell
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
:exclude-members: __init__
39+
40+
.. autoclass:: xtl.jobs.shells.DefaultShell
41+
:members:
42+
:undoc-members:
43+
:show-inheritance:
44+
45+
.. autoclass:: xtl.jobs.shells.ShellType
46+
:members:
47+
:undoc-members:
48+
:show-inheritance:

docs/source/api/xtl.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Subpackages
1717

1818
xtl.common
1919
xtl.config
20+
xtl.jobs

src/xtl/common/compatibility.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@
2727
# TODO: Remove when dropping support for Python 3.13 (EOL: 10/2029)
2828
PY313_OR_LESS: bool = (PY_VERS < (3, 14))
2929
"""Python version is 3.13 or less"""
30+
# Features missing in Python 3.13:
31+
# - Deferred evaluation of annotations (`from __future__ import annotations`)
3032

3133
# TODO: Remove when dropping support for Python 3.14 (EOL: 10/2030)
3234
PY314_OR_LESS: bool = (PY_VERS < (3, 15))
35+
"""Python version is 3.14 or less"""
3336

3437
#############
3538
# OS checks #

src/xtl/config/settings.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,18 @@ def initialize(cls) -> 'XTLSettings':
262262
# Check settings version
263263
_v = version_from_str(_settings.version)
264264
if _v.tuple_safe < current_version.tuple_safe:
265-
logger.warn('Using settings from an older version of XTL %(version)s.',
266-
{'version': _v.string})
265+
logger.warning('Using settings from an older version of XTL %(version)s.',
266+
{'version': _v.string})
267267
elif _v.tuple_safe > current_version.tuple_safe:
268-
logger.warn('Using settings from a newer version of XTL %(version)s. '
269-
'XTL might not behave as intended. Use at your own risk!',
270-
{'version': _v.string})
268+
logger.warning('Using settings from a newer version of XTL %(version)s. '
269+
'XTL might not behave as intended. Use at your own risk!',
270+
{'version': _v.string})
271271

272272
# Check for extra keys in the nested Options
273273
extra = _settings.__pydantic_extra__ or dict()
274274
extra.update(_get_extra_keys(_settings))
275275
if extra:
276-
logger.warng('Found and ignored unknown keys in the config file',
277-
extra=extra)
276+
logger.warning('Found and ignored unknown keys in the config file',
277+
extra=extra)
278278

279279
return _settings

src/xtl/jobs/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .shells import *

0 commit comments

Comments
 (0)