Skip to content

Commit

Permalink
Switch to ruff and address issues (#31)
Browse files Browse the repository at this point in the history
* Switch to ruff and address issues

* Remove faulty typehints for py3.8
  • Loading branch information
dobraczka authored Feb 21, 2024
1 parent 9a883ad commit 6c5ad86
Show file tree
Hide file tree
Showing 24 changed files with 988 additions and 1,055 deletions.
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.3.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added id mapped dataset class
- Added canonical name property
- Added canonical name property
- Added dask support
- Added dataset names
- Added caching functionality
Expand All @@ -34,4 +34,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.1.1]: https://github.com/dobraczka/sylloge/releases/tag/v0.1.1
[0.2.0]: https://github.com/dobraczka/sylloge/releases/tag/v0.2.0
[0.2.1]: https://github.com/dobraczka/sylloge/releases/tag/v0.2.1

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ After the initial read datasets are cached using this format. The `cache_path` c
Some datasets come with pre-determined splits:

```bash
tree ~/.data/sylloge/open_ea/cached/D_W_15K_V1
tree ~/.data/sylloge/open_ea/cached/D_W_15K_V1
├── attr_triples_left_parquet
├── attr_triples_right_parquet
├── dataset_names.txt
Expand Down Expand Up @@ -131,7 +131,7 @@ tree ~/.data/sylloge/oaei/cached/starwars_swg
Installation
============
```bash
pip install sylloge
pip install sylloge
```

Datasets
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def setup(app):
# -- Project information -----------------------------------------------------

project = "sylloge"
copyright = "2022, Daniel Obraczka"
copyright = "2022, Daniel Obraczka" # noqa: A001
author = "Daniel Obraczka"

# The full version, including alpha/beta/rc tags
Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Some datasets come with pre-determined splits:

.. code-block:: bash
tree ~/.data/sylloge/open_ea/cached/D_W_15K_V1
tree ~/.data/sylloge/open_ea/cached/D_W_15K_V1
├── attr_triples_left_parquet
├── attr_triples_right_parquet
├── dataset_names.txt
Expand Down Expand Up @@ -124,8 +124,8 @@ some don't:
You can install sylloge via pip:

.. code-block:: bash
pip install sylloge
pip install sylloge
Expand Down
4 changes: 2 additions & 2 deletions docs/source/apidoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Base
:nosignatures:

sylloge.base.TrainTestValSplit
sylloge.base.EADataset
sylloge.base.CacheableEADataset
sylloge.base.EADataset
sylloge.base.CacheableEADataset
sylloge.base.ZipEADataset
sylloge.base.ZipEADatasetWithPreSplitFolds

Expand Down
42 changes: 21 additions & 21 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@ def tests(session: Session) -> None:
locations = ["sylloge", "tests", "noxfile.py"]


@session(tags=["not test", "style"]) # type: ignore
@session(tags=["not test", "style"]) # type: ignore[call-overload]
def lint(session: Session) -> None:
args = session.posargs or locations
session.install("black", "isort")
session.run("black", *args)
session.run("isort", *args)
session.install("pre-commit")
session.run(
"pre-commit",
"run",
"--all-files",
"--hook-stage=manual",
*session.posargs,
)


@session(tags=["not test", "style"]) # type: ignore
@session(tags=["not test", "style"]) # type: ignore[call-overload]
def style_checking(session: Session) -> None:
args = session.posargs or locations
session.install(
"pyproject-flake8",
"flake8-eradicate",
"flake8-isort",
"flake8-debugger",
"flake8-comprehensions",
"flake8-print",
"flake8-black",
"flake8-black",
"darglint",
"pydocstyle",
)
session.run("pflake8", "--docstring-style", "sphinx", *args)
session.install("ruff")
session.run("ruff", "check", *args)


@session()
def pyroma(session: Session) -> None:
session.install("poetry-core>=1.0.0")
session.install("pyroma")
session.run("pyroma", "--min", "10", ".")


@session(tags=["not test", "style"]) # type: ignore
@session(tags=["not test", "style"]) # type: ignore[call-overload]
def type_checking(session: Session) -> None:
args = session.posargs or locations
session.run_always("poetry", "install", external=True)
Expand All @@ -54,7 +54,7 @@ def type_checking(session: Session) -> None:
)


@session(tags=["not test"]) # type: ignore
@session(tags=["not test"]) # type: ignore[call-overload]
def build_docs(session: Session) -> None:
session.install(".[docs]")
session.install("sphinx")
Expand Down
Loading

0 comments on commit 6c5ad86

Please sign in to comment.