Skip to content

Commit

Permalink
Merge pull request #91 from Materials-Data-Science-and-Informatics/fe…
Browse files Browse the repository at this point in the history
…ature/update_hooks

update pre-commit hooks and dependencies
  • Loading branch information
mustafasoylu committed Jul 23, 2024
2 parents 6257f3a + 324b4c3 commit a1548c9
Show file tree
Hide file tree
Showing 43 changed files with 1,010 additions and 786 deletions.
128 changes: 64 additions & 64 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
repos:
# Various general + format-specific helpers
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-symlinks
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=lf]
- id: check-yaml
exclude: "mkdocs.yml"
- id: check-toml
- id: check-json
- id: check-ast
- id: debug-statements
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-added-large-files
args: [--maxkb=10000]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.22.0"
hooks:
- id: check-github-workflows
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.6
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.1.1"
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
# NOTE: you might need to add some deps here:
additional_dependencies: []
# Various general + format-specific helpers
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-symlinks
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=lf]
- id: check-yaml
exclude: 'mkdocs.yml'
- id: check-toml
- id: check-json
- id: check-ast
- id: debug-statements
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-added-large-files
args: [--maxkb=10000]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: '0.29.0'
hooks:
- id: check-github-workflows
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.4
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.11.0'
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
# NOTE: you might need to add some deps here:
additional_dependencies: []

# Metadata
- repo: https://github.com/citation-file-format/cff-converter-python
rev: "44e8fc9"
hooks:
- id: validate-cff
- repo: https://github.com/fsfe/reuse-tool
rev: "v1.1.2"
hooks:
- id: reuse
# Metadata
- repo: https://github.com/citation-file-format/cff-converter-python
rev: '054bda51dbe278b3e86f27c890e3f3ac877d616c'
hooks:
- id: validate-cff
- repo: https://github.com/fsfe/reuse-tool
rev: 'v4.0.3'
hooks:
- id: reuse

- repo: local
hooks:
# NOTE: copy from .pre-commit-hooks.yaml, for technical reasons
- id: somesy-sync
name: Run somesy sync
entry: somesy sync
language: python
files: '^\.somesy\.toml|pyproject\.toml$'
pass_filenames: false
- repo: local
hooks:
# NOTE: copy from .pre-commit-hooks.yaml, for technical reasons
- id: somesy-sync
name: Run somesy sync
entry: somesy sync
language: python
files: '^\.somesy\.toml|pyproject\.toml$'
pass_filenames: false

- id: somesy-fill
name: Update AUTHORS.md
entry: somesy fill -t docs/_template_authors.md -o AUTHORS.md
language: python
files: '^\.somesy\.toml|pyproject\.toml$'
pass_filenames: false
- id: somesy-fill
name: Update AUTHORS.md
entry: somesy fill -t docs/_template_authors.md -o AUTHORS.md
language: python
files: '^\.somesy\.toml|pyproject\.toml$'
pass_filenames: false
1 change: 1 addition & 0 deletions docs/scripts/coverage_status.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mkdocs hook to run tests with coverage collection and generate a badge."""

import logging
from io import StringIO
from pathlib import Path
Expand Down
1,479 changes: 826 additions & 653 deletions poetry.lock

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,45 @@ include = [

[tool.poetry.dependencies]
python = "^3.8"
pydantic = {extras = ["email"], version = "^2.4.2"}
ruamel-yaml = "^0.17.21"
tomlkit = "^0.11.6"
importlib-metadata = "^4.11.0"
typer = {extras = ["all"], version = "^0.7.0"}
pydantic = {extras = ["email"], version = "^2.8.2"}
ruamel-yaml = "^0.18.6"
tomlkit = "^0.13.0"
importlib-metadata = "^8.0.0"
typer = {extras = ["all"], version = "^0.12.3"}
cffconvert = "^2.0.0"
wrapt = "^1.15.0"
packaging = "^23.1"
jinja2 = "^3.1.2"
wrapt = "^1.16.0"
packaging = "^24.1"
jinja2 = "^3.1.4"
defusedxml = "^0.7.1"

[tool.poetry.group.dev.dependencies]
poethepoet = "^0.18.1"
pre-commit = "^3.1.1"
pytest = "^7.2.2"
pytest-cov = "^4.0.0"
hypothesis = "^6.68.2"
licensecheck = "^2023.1.1"
pytest-mock = "^3.10.0"
poethepoet = "^0.27.0"
pre-commit = "^3.5.0"
pytest = "^8.3.1"
pytest-cov = "^5.0.0"
hypothesis = "^6.108.4"
licensecheck = "^2024.2"
pytest-mock = "^3.14.0"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
mkdocs = "^1.4.2"
mkdocstrings = {extras = ["python"], version = "^0.24.0"}
mkdocs-material = "^9.4"
mkdocs = "^1.6.0"
mkdocstrings = {extras = ["python"], version = "^0.25.1"}
mkdocs-material = "^9.5.30"
mkdocs-gen-files = "^0.5.0"
mkdocs-literate-nav = "^0.6.0"
mkdocs-section-index = "^0.3.5"
mkdocs-macros-plugin = "^0.7.0"
mkdocs-literate-nav = "^0.6.1"
mkdocs-section-index = "^0.3.9"
mkdocs-macros-plugin = "^1.0.5"
markdown-include = "^0.8.1"
pymdown-extensions = "^10.2"
markdown-exec = {extras = ["ansi"], version = "^1.6.0"}
mkdocs-coverage = "^1.0.0"
mike = "^2.0.0"
pymdown-extensions = "^10.8.1"
markdown-exec = {extras = ["ansi"], version = "^1.9.3"}
mkdocs-coverage = "^1.1.0"
mike = "^2.1.2"
anybadge = "^1.14.0"
interrogate = "^1.5.0"
black = "^23.3.0"
interrogate = "^1.7.0"
black = "^24.4.2"
mkdocs-exclude = "^1.0.2"

[tool.poetry.scripts]
Expand Down
1 change: 1 addition & 0 deletions src/somesy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""somesy package."""

import importlib_metadata
from typing_extensions import Final

Expand Down
1 change: 1 addition & 0 deletions src/somesy/cff/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CFF module."""

from .writer import CFF

__all__ = ["CFF"]
1 change: 1 addition & 0 deletions src/somesy/cff/writer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Citation File Format (CFF) parser and saver."""

import json
from pathlib import Path
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions src/somesy/cli/fill.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fill command of somesy."""

import logging
from pathlib import Path
from sys import stdin
Expand Down
1 change: 1 addition & 0 deletions src/somesy/cli/init.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Set config files for somesy."""

import logging
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/somesy/cli/sync.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sync command for somesy."""

import logging
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/somesy/cli/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utility functions for CLI commands."""

import logging
import traceback
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions src/somesy/codemeta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Integration with codemeta.json (to re-generate codemeta as part of somesy sync)."""

from .writer import CodeMeta

__all__ = ["CodeMeta"]
2 changes: 2 additions & 0 deletions src/somesy/codemeta/writer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""codemeta.json creation module."""

import logging
from collections import OrderedDict
from pathlib import Path
Expand Down Expand Up @@ -158,6 +159,7 @@ def _sync_person_list(self, old: List[Any], new: List[Person]) -> List[Any]:
Returns:
List[Any]: _description_
"""
return new

Expand Down
1 change: 1 addition & 0 deletions src/somesy/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Commands for somesy."""

from .init_config import init_config
from .sync import sync

Expand Down
2 changes: 2 additions & 0 deletions src/somesy/commands/init_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CLI command to initialize somesy configuration file."""

import logging
from pathlib import Path

Expand All @@ -16,6 +17,7 @@ def init_config(input_path: Path, options: dict) -> None:
Args:
input_path (Path): Path to somesy file (will be created/overwritten).
options (dict): CLI options.
"""
logger.info(f"Updating input file ({input_path}) with CLI configurations...")

Expand Down
1 change: 1 addition & 0 deletions src/somesy/commands/sync.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sync selected metadata files with given input file."""

import logging
from pathlib import Path
from typing import Type
Expand Down
3 changes: 3 additions & 0 deletions src/somesy/core/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Core somesy functions."""

import json
import logging
from pathlib import Path
Expand Down Expand Up @@ -31,6 +32,7 @@ def discover_input(input_file: Optional[Path] = None) -> Path:
Returns:
somesy configuration file path.
"""
if input_file:
if input_file.is_file():
Expand Down Expand Up @@ -71,6 +73,7 @@ def get_input_content(path: Path, *, no_unwrap: bool = False) -> Dict[str, Any]:
Raises:
ValueError: if the input file is not a valid somesy input file or if the file is not a TOML file.
RuntimeError: if the input file does not contain a somesy input section at expected key
"""
logger.debug(f"Path {path}")
# somesy.toml / .somesy.toml
Expand Down
1 change: 1 addition & 0 deletions src/somesy/core/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Somesy log configuration."""

import logging
from enum import Enum, auto
from typing import Optional
Expand Down
Loading

0 comments on commit a1548c9

Please sign in to comment.