Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #140

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ci:
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
Expand All @@ -19,7 +19,7 @@ repos:
# ----- Python formatting -----
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.6
rev: v0.8.1
hooks:
# Run the linter.
- id: ruff
Expand All @@ -29,10 +29,10 @@ repos:
# Run the formatter.
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.2.1
rev: v2.5.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
rev: v0.23
hooks:
- id: validate-pyproject
21 changes: 14 additions & 7 deletions demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"metadata": {},
"outputs": [],
"source": [
"import abc\n",
"%load_ext autoreload\n",
"%autoreload 2"
]
Expand All @@ -19,11 +18,14 @@
"source": [
"import inspect\n",
"from unittest.mock import MagicMock\n",
"\n",
"from weldx_widgets.widget_base import WidgetBase as base\n",
"\n",
"\n",
"def all_subclasses(cls):\n",
" return set(cls.__subclasses__()).union(\n",
" [s for c in cls.__subclasses__() for s in all_subclasses(c)])"
" [s for c in cls.__subclasses__() for s in all_subclasses(c)]\n",
" )"
]
},
{
Expand All @@ -44,20 +46,25 @@
" for k, v in args.parameters.items():\n",
" if k == \"self\":\n",
" continue\n",
" if k!= \"kwargs\" and v.POSITIONAL_OR_KEYWORD and v.default is inspect.Parameter.empty:\n",
" if (\n",
" k != \"kwargs\"\n",
" and v.POSITIONAL_OR_KEYWORD\n",
" and v.default is inspect.Parameter.empty\n",
" ):\n",
" _mock_args[k] = MagicMock()\n",
" print(\"mocked \",k,v)\n",
" print(\"mocked \", k, v) # noqa: T201\n",
" try:\n",
" all_widgets.append(cls(**_mock_args))\n",
" except TypeError as te:\n",
" print(cls, te)\n",
" print(cls, te) # noqa: T201\n",
" continue"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
Expand All @@ -75,7 +82,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "weldx real",
"display_name": "weldx",
"language": "python",
"name": "weldx"
},
Expand All @@ -89,7 +96,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Physics",
]

Expand Down
Loading