Skip to content

Commit

Permalink
Merge branch 'main' into improve-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis committed Apr 10, 2023
2 parents da3f1a5 + fd3f2b4 commit 2e851a8
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 34 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -U setuptools wheel
while IFS="" read -r line || [ -n "${line}" ]; do
if [[ "${line}" =~ ^pre-commit.*$ ]]; then
pre_commit="${line}"
fi
done < dic2owl/requirements_dev.txt
pip install ${pre_commit}
pip install pre-commit
- name: Run pre-commit
run: SKIP=pylint,mypy,black,bandit,requirements-txt-fixer pre-commit run --all-files
11 changes: 2 additions & 9 deletions .github/workflows/ci_dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@ jobs:
run: |
python -m pip install -U pip
pip install -U setuptools wheel
while IFS="" read -r line || [ -n "${line}" ]; do
if [[ "${line}" =~ ^pre-commit.*$ ]]; then
pre_commit="${line}"
fi
done < dic2owl/requirements_dev.txt
pip install ${pre_commit}
pip install pre-commit
- name: Set up git user info
run: |
Expand Down Expand Up @@ -82,7 +75,7 @@ jobs:

- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.RELEASE_PAT_CWA }}
commit-message: New @dependabot-fueled updates
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/dic2owl_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -U setuptools wheel
while IFS="" read -r line || [ -n "${line}" ]; do
if [[ "${line}" =~ ^pre-commit.*$ ]]; then
pre_commit="${line}"
fi
done < dic2owl/requirements_dev.txt
pip install ${pre_commit}
pip install pre-commit
- name: Run pre-commit
run: SKIP=pylint pre-commit run --all-files
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-symlinks
- id: check-xml
Expand All @@ -19,22 +19,22 @@ repos:
exclude: ^.*(\.ttl|\.cif)$

- repo: https://github.com/ambv/black
rev: 22.10.0
rev: 23.3.0
hooks:
- id: black
args:
- --config=dic2owl/pyproject.toml

- repo: https://github.com/PyCQA/bandit
rev: '1.7.4'
rev: '1.7.5'
hooks:
- id: bandit
args: [-r]
exclude: ^tests/.*$
files: ^dic2owl/.*$

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v1.1.1
hooks:
- id: mypy
exclude: ^tests/.*$
Expand Down
6 changes: 5 additions & 1 deletion dic2owl/dic2owl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@
ontology-generation tool for CIF `.dic`-files.
"""
import argparse
from typing import TYPE_CHECKING

# import logging
from pathlib import Path

if TYPE_CHECKING: # pragma: no cover
from typing import List, Optional


# LOGGING_LEVELS = [
# logging.getLevelName(level).lower() for level in range(0, 51, 10)
# ]


def main(argv: list = None) -> None:
def main(argv: "Optional[List[str]]" = None) -> None:
"""Ontologize CIF dictionaries (`.dic`) using OWL.
Produce an OWL Turtle (`.ttl`) file from a CIF dictionary (`.dic`) file.
Expand Down
1 change: 0 additions & 1 deletion dic2owl/dic2owl/dic2owl.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ class `cls`.
"""
for annotation_name, value in item.items():

# Add new annotation to generated ontology
if annotation_name not in self.ddl:
raise MissingAnnotationError(annotation_name)
Expand Down
7 changes: 4 additions & 3 deletions dic2owl/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pre-commit~=2.20
pylint~=2.15
pytest~=7.1
pre-commit~=2.21; python_version<"3.8"
pre-commit~=3.2; python_version>="3.8"
pylint~=2.17
pytest~=7.2
pytest-cov~=4.0

0 comments on commit 2e851a8

Please sign in to comment.