Skip to content

Commit

Permalink
Fix module not found error in tests (#4)
Browse files Browse the repository at this point in the history
* 🔨 Try and error #00

* 🔨 Try and error #1

* 🔨 Try and error #2

* 🔨 Try and error #3

* 🔨 Try and error #4

* 🔨 Try and error #5

rename package name
  • Loading branch information
hf-krechan committed Jun 17, 2021
1 parent d660520 commit 190cf44
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 14 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions AHB_Extractor/__main__.py → ahbextractor/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
This file makes the package itself executable.
You can run it with:
python -m ahb_extractor
python -m ahbextractor
"""

from ahb_extractor import app
from ahbextractor import ahbextractor

if __name__ == "__main__":
app.main()
ahbextractor.main()
4 changes: 2 additions & 2 deletions AHB_Extractor/app.py → ahbextractor/ahbextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

import docx

from ahb_extractor.helper.read_functions import get_ahb_extract
from ahbextractor.helper.read_functions import get_ahb_extract


def main():
"""
Main function of the module ahb_extractor.
Main function of the module ahbextractor.
It reads the docx file and calls the function to extract all infos.
"""

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from docx.table import Table, _Cell
from docx.text.paragraph import Paragraph

from ahb_extractor.helper.check_row_type import RowType, define_row_type
from ahb_extractor.helper.export_functions import export_all_pruefidentifikatoren_in_one_file, export_pruefidentifikator
from ahb_extractor.helper.write_functions import write_new_row_in_dataframe
from ahbextractor.helper.check_row_type import RowType, define_row_type
from ahbextractor.helper.export_functions import export_all_pruefidentifikatoren_in_one_file, export_pruefidentifikator
from ahbextractor.helper.write_functions import write_new_row_in_dataframe


def get_all_paragraphs_and_tables(parent):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from docx.table import Table, _Cell
from docx.text.paragraph import Paragraph

from ahb_extractor.helper.check_row_type import RowType
from ahbextractor.helper.check_row_type import RowType


def parse_paragraph_in_edifact_struktur_column_to_dataframe(
Expand Down
11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from setuptools import find_packages, setup

setup(
name="ahbextractor",
version="0.0.0",
author="Kevin Krechan",
author_email="kevin.krechan@hochfrequenz.de",
description="Tool to generate machine readable files from AHB documents.",
packages=find_packages(),
install_requires=["openpyxl", "pandas", "python-docx", "XlsxWriter"],
)
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ envlist =
linting
coverage
skip_missing_interpreters = True
skipsdist = True
; isolated_build = True
; skipsdist = True

[testenv]
commands = python -m pip install --upgrade pip
Expand All @@ -14,7 +15,7 @@ commands = python -m pip install --upgrade pip
deps =
-rrequirements.txt
pytest
commands = python -m pytest --basetemp={envtmpdir} {posargs}
commands = pytest --basetemp={envtmpdir} {posargs}

[testenv:linting]
# the linting environment is called by the Github Action that runs the linter
Expand All @@ -23,7 +24,7 @@ deps =
pylint
# add your fixtures like e.g. pytest_datafiles here
commands =
pylint ahb_extractor
pylint ahbextractor

[testenv:coverage]
# the coverage environment is called by the Github Action that runs the coverage measurement
Expand Down
2 changes: 1 addition & 1 deletion unittests/test_check_row_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from docx.shared import RGBColor

from ahb_extractor.helper.check_row_type import RowType, define_row_type
from ahbextractor.helper.check_row_type import RowType, define_row_type


class TestCheckRowType:
Expand Down
2 changes: 1 addition & 1 deletion unittests/test_write_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pandas as pd
import pytest

from ahb_extractor.helper.write_functions import (
from ahbextractor.helper.write_functions import (
parse_bedingung_cell,
parse_paragraph_in_edifact_struktur_column_to_dataframe,
parse_paragraph_in_middle_column_to_dataframe,
Expand Down

0 comments on commit 190cf44

Please sign in to comment.