Skip to content

Commit 0ed64ab

Browse files
committed
Updated config files.
1 parent 1b482a0 commit 0ed64ab

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

.github/workflows/cleanup.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is managed by 'repo_helper'. Don't edit it directly.
2+
---
3+
name: Artefact Cleaner
4+
on:
5+
schedule:
6+
- cron: 0 9 1 * *
7+
jobs:
8+
Clean:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: cleanup
12+
uses: glassechidna/artifact-cleaner@v2
13+
with:
14+
minimumAge: 1000000.0

doc-source/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ extras-require>=0.2.0
55
pandas>=1.1.2
66
seed-intersphinx-mapping>=0.1.1
77
sphinx>=3.0.3
8-
sphinx-autofixture>=0.1.0
8+
sphinx-autofixture>=0.2.1
99
sphinx-copybutton>=0.2.12
1010
sphinx-notfound-page>=0.5
1111
sphinx-prompt>=1.1.0
1212
sphinx-tabs>=1.1.13
13-
sphinx-toolbox>=1.7.3
13+
sphinx-toolbox>=1.7.5
1414
sphinxcontrib-httpdomain>=1.7.0
1515
sphinxemoji>=0.1.6
1616
toctree-plus>=0.0.4

domdf_python_tools/testing.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,20 +322,26 @@ def platform_boolean_factory(
322322
condition: bool,
323323
platform: str,
324324
versionadded: Optional[str] = None,
325+
*,
326+
module: Optional[str] = None,
325327
) -> Tuple[Callable[..., MarkDecorator], Callable[..., MarkDecorator]]:
326328
"""
327329
Factory function to return decorators such as :func:`~.not_pypy` and :func:`~.only_windows`.
328330
329331
:param condition: Should evaluate to :py:obj:`True` if the test should be skipped.
330332
:param platform:
331333
:param versionadded:
334+
:param module: The module to set the function as belonging to in ``__module__``.
332335
333336
:return: 2-element tuple of ``not_function``, ``only_function``.
334337
335338
.. versionadded: 1.5.0
339+
340+
.. versionchanged: 1.7.1 Added the ``module`` keyword-only argument.
336341
"""
337342

338343
default_reason = "{} required on Windows"
344+
module = module or platform_boolean_factory.__module__
339345

340346
def not_function(reason: str = default_reason.format("Not")) -> MarkDecorator:
341347
return pytest.mark.skipif(condition=condition, reason=reason)
@@ -355,10 +361,12 @@ def only_function(reason: str = default_reason.format("Only")) -> MarkDecorator:
355361
if versionadded:
356362
docstring += f"\n\n:rtype:\n\n.. versionadded:: {versionadded}"
357363

358-
not_function.__name__ = f"not_{platform.lower()}"
364+
not_function.__name__ = not_function.__qualname__ = f"not_{platform.lower()}"
365+
not_function.__module__ = module
359366
not_function.__doc__ = docstring.format(why="if", platform=platform)
360367

361-
only_function.__name__ = f"only_{platform.lower()}"
368+
only_function.__name__ = only_function.__qualname__ = f"only_{platform.lower()}"
369+
only_function.__module__ = module
362370
only_function.__doc__ = docstring.format(why="unless", platform=platform)
363371

364372
return not_function, only_function
@@ -405,7 +413,7 @@ def is_docker():
405413
not_docker.__doc__ = cast(str, not_docker.__doc__).replace("the current platform is", "running on")
406414
only_docker.__doc__ = cast(str, only_docker.__doc__).replace("the current platform is", "running on")
407415

408-
not_pypy, only_pypy = platform_boolean_factory(condition=PYPY, platform="Docker", versionadded="0.9.0")
416+
not_pypy, only_pypy = platform_boolean_factory(condition=PYPY, platform="PyPy", versionadded="0.9.0")
409417
not_pypy.__doc__ = cast(str, not_pypy.__doc__).replace("current platform", "current Python implementation")
410418
only_pypy.__doc__ = cast(str, only_pypy.__doc__).replace("current platform", "current Python implementation")
411419

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ python =
3636
3.10-dev: py310-dev, build
3737

3838
[testenv:docs]
39-
setenv =
40-
SHOW_TODOS = 1
41-
PIP_USE_FEATURE = 2020-resolver
39+
setenv = SHOW_TODOS = 1
4240
basepython = python3.8
4341
changedir = {toxinidir}/doc-source
4442
extras = all

0 commit comments

Comments
 (0)