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 #932

Merged
merged 6 commits into from
Jun 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
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/setup-micromamba@v1.9.0
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/setup-micromamba@v1.9.0
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
Loading