Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/pytz-2023.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein committed Jan 29, 2024
2 parents f228ec7 + 2e93cee commit 0b4b462
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Black"
name: "Formatting"

on: [push]
jobs:
Expand All @@ -8,6 +8,7 @@ jobs:
matrix:
python-version: ["3.12"]
os: [ubuntu-latest]
tool: ["black", "isort"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -17,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
- name: Black Code Formatter
pip install -r dev_requirements/requirements-formatting.txt
- name: ${{ matrix.tool }} Code Formatter
run: |
black . --check
${{ matrix.tool }} . --check
3 changes: 3 additions & 0 deletions dev_requirements/requirements-formatting.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# specific requirements for the tox formatting environment
black
isort
22 changes: 22 additions & 0 deletions dev_requirements/requirements-formatting.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements-formatting.in
#
black==24.1.1
# via -r requirements-formatting.in
click==8.1.7
# via black
colorama==0.4.6
# via click
isort==5.12.0
# via -r requirements-formatting.in
mypy-extensions==1.0.0
# via black
packaging==23.2
# via black
pathspec==0.12.1
# via black
platformdirs==4.1.0
# via black
1 change: 1 addition & 0 deletions src/kohlrahbi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
kohlrahbi is a package to scrape AHBs (in docx format)
"""

import fnmatch
import gc
import json
Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/ahb/ahbtable.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module provides the AhbTable class
"""

from pathlib import Path
from typing import Union

Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/ahb/ahbtablerow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the class AhbTableRow
"""

from typing import Optional

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/changehistory/changehistorytable.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module provides the ChangeHistoryTable class
"""

import attrs
import pandas as pd
from docx.table import Table # type:ignore[import]
Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/collect_pruefis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Use this script to create an updated version of the all_known_pruefis.toml file.
You should run it every time there is an update at edi-energy.de.
"""

from datetime import date
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/docxfilefinder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the DocxFileFinder class.
"""

from itertools import groupby
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/docxtablecells/bodycell.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the class BodyCell
"""

import attrs
import pandas as pd
from docx.table import _Cell # type:ignore[import]
Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/docxtablecells/edifactstrukturcell.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the class EdifactStrukturCell
"""

import re

import attrs
Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/logger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module provides a logger instance for kohlrahbi
"""

import logging.config
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/read_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A collection of functions to get information from AHB tables.
"""

import re
from datetime import datetime
from typing import Generator, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/row_type_checker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains all functions to define the type of a row of the tables in an AHB.
"""

from docx.oxml.ns import qn # type:ignore[import]
from docx.oxml.parser import OxmlElement # type:ignore[import]
from docx.shared import RGBColor # type:ignore[import]
Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/unfoldedahb/unfoldedahbtable.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the UnfoldedAhbTable class.
"""

import copy
import json
import re
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ deps =
{[testenv:tests]deps}
{[testenv:linting]deps}
{[testenv:coverage]deps}
black
isort
-r dev_requirements/requirements-formatting.txt
pip-tools
pre-commit
commands =
Expand Down
1 change: 1 addition & 0 deletions unittests/test_docx_extensions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
tests all the features the kohlrahbi package provides to process Docx files (by using the docx package)
"""

import pytest # type:ignore[import]
from _pytest.fixtures import SubRequest # type:ignore[import]
from docx import Document # type:ignore[import]
Expand Down

0 comments on commit 0b4b462

Please sign in to comment.