Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#932)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.3 → v0.4.7](astral-sh/ruff-pre-commit@v0.4.3...v0.4.7)
- [github.com/tox-dev/pyproject-fmt: 1.8.0 → 2.1.3](tox-dev/pyproject-fmt@1.8.0...2.1.3)
- [github.com/abravalheri/validate-pyproject: v0.16 → v0.18](abravalheri/validate-pyproject@v0.16...v0.18)
- https://github.com/codespell-project/codespell/: v2.2.6 → v2.3.0

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pytest.yml

* Update pytest.yml

* cleanup and move to .ruff.toml

* pyproject.toml

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Çağtay Fabry <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and CagtayFabry authored Jun 4, 2024
1 parent fa2deea commit 31f75fe
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 150 deletions.
20 changes: 0 additions & 20 deletions .flake8

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
with:
fetch-depth: '0' # Fetch all history for all tags and branches

- uses: CagtayFabry/pydeps2env@main
- uses: CagtayFabry/pydeps2env@v1.1.0
with:
file: 'pyproject.toml'
files: 'pyproject.toml'
channels: 'conda-forge defaults'
extras: 'test vis media'
setup_requires: 'include'
build_system: 'include'

- name: Setup Conda Environment
uses: mamba-org/[email protected]
Expand Down Expand Up @@ -139,12 +139,12 @@ jobs:
with:
fetch-depth: '0' # Fetch all history for all tags and branches

- uses: CagtayFabry/pydeps2env@main
- uses: CagtayFabry/pydeps2env@v1.1.0
with:
file: 'pyproject.toml'
files: 'pyproject.toml'
channels: 'conda-forge defaults'
extras: 'test vis media'
setup_requires: 'include'
build_system: 'include'

- name: Setup Conda Environment
uses: mamba-org/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- mdformat-config
# ----- Python formatting -----
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
rev: v0.4.7
hooks:
# Run ruff linter.
- id: ruff
Expand All @@ -39,11 +39,11 @@ repos:
# Run ruff formatter.
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.8.0
rev: 2.1.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
rev: v0.18
hooks:
- id: validate-pyproject
# ----- Jupyter Notebooks -----
Expand All @@ -63,7 +63,7 @@ repos:
- --remove-kernel-metadata
# ----- spellchecking -----
- repo: https://github.com/codespell-project/codespell/
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
exclude: doc/src/legal-notice.md
Expand Down
81 changes: 81 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Exclude a variety of commonly ignored directories.
extend-exclude = [
"__init__.py",
"doc/src/conf.py",
]

# Same as Black.
line-length = 88
indent-width = 4

# Assume Python 3.9
target-version = "py39"


[lint]
# TODO: should be the following list, but Ruff does not yet impl all of them.
# W503,W504
# E203
# C408
ignore = [
"C408",
#"E203",
"E402",
#"W503",
#"W504",
"D203",
"D211",
"D213",
"UP006",
"UP007", # see ruff GH#4427
]
select = [
"B", # flake8-bugbear
"C", # flake8-comprehensions
#"D", # note: all relevant D's will be set by setting pydocstyle.convention=numpy!
"E", # pycodestyles
"F", # pyflakes
"W", # pycodestyle warnings
"UP", # pyupgrade
"T2", # flake8-print
"I001", # isort
"ICN", # import conventions, e.g. import numpy as np
#"B950", # not yet implemented by Ruff.
"RUF100", # ensure 'noqa' declarations are still valid.
]

[lint.extend-per-file-ignores]
# Allow pydocstyle violations in certain areas.
"**/{tests,tags,asdf,devtools}/**" = [
"D",
]
"conftest.py" = [
"D",
]
"doc/src/tutorials/*" = [
"D",
]
"doc/src/conf.py" = [
"E501", # ignore long lines.
"RUF100", # do no check if 'noqa' is needed (circular import workaround)
]
"**/{cli,tests,tutorials,devtools}/**/*{.py,ipynb}" = [
"T2",
] # Allow prints in certain areas.

[lint.pydocstyle]
convention = "numpy"

[lint.mccabe]
max-complexity = 15 # max branches inside a function.

[lint.isort]
known-first-party = [
"weldx",
]
required-imports = [
"from __future__ import annotations",
]

[flake8-import-conventions]
extend-aliases = { xarray = "xr" }
11 changes: 9 additions & 2 deletions doc/json_mime_render_plugin/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[project]
name = "myst-nb-json-renderer"
version = "1"
[project.entry-points."myst_nb.mime_renderers"]
json_mime = "myst_nb_json_render_plugin:MimeRenderPlugin"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
entry-points."myst_nb.mime_renderers".json_mime = "myst_nb_json_render_plugin:MimeRenderPlugin"
2 changes: 1 addition & 1 deletion doc/src/tutorials/timeseries_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can also use `Quantites` with the appropriate dimension as Inputs for our interpolation:"
"We can also use `Quantities` with the appropriate dimension as Inputs for our interpolation:"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
"metadata": {},
"source": [
"The `SpatialData` class we used above is mostly a container class for 3d data.\n",
"Additionally to pure point data, it can also store connectivety data in form of triangles.\n",
"Additionally to pure point data, it can also store connectivity data in form of triangles.\n",
"Consult the [class documentation](https://weldx.readthedocs.io/en/latest/_autosummary/weldx.SpatialData.html#weldx.SpatialData) for further information.\n",
"Now we add the data to the CSM:"
]
Expand Down
Loading

0 comments on commit 31f75fe

Please sign in to comment.