diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb3f082..4943ae7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,25 +3,15 @@ name: ci on: push jobs: - ci: - strategy: - matrix: - platform: [ubuntu-latest, macos-latest] - python-version: ["3.9.16", "3.10.9"] + test: - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} - - # - name: cache poetry install - # uses: actions/cache@v2 - # with: - # path: ~/.local - # key: poetry-1.1.12-0 + python-version: "3.10" - uses: snok/install-poetry@v1 with: @@ -29,27 +19,12 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true - # - name: cache deps - # id: cache-deps - # uses: actions/cache@v2 - # with: - # path: .venv - # key: pydeps-${{ hashFiles('**/poetry.lock') }} - run: poetry install --no-interaction --no-root - # if: steps.cache-deps.outputs.cache-hit != 'true' - - run: | - poetry run coverage run -m unittest - poetry run coverage xml + - run: poetry run pytest --cov --cov-report xml:coverage.xml --cov-append -vv --hypothesis-show-statistics - name: Run codacy-coverage-reporter uses: codacy/codacy-coverage-reporter-action@v1 with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: coverage.xml - - - uses: codecov/codecov-action@v3 - with: - fail_ci_if_error: false - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml diff --git a/.gitignore b/.gitignore index cb94e18..df31091 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,7 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file +#.idea/ + +.vscode/ +poetry.lock diff --git a/pyproject.toml b/pyproject.toml index ed639bf..e017e8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,17 +23,24 @@ biopython = "1.80" freesasa = "2.2.1" numpy = "^1.22.0" +[tool.poetry.group.test.dependencies] +pytest = "^8.1.1" +coverage = "^7.4.4" +pytest-cov = "^5.0.0" +hypothesis = "^6.100.1" + [tool.poetry.scripts] prodigy = "prodigy.predict_IC:main" -[tool.poetry.group.test.dependencies] -coverage = "^7.1.0" - [tool.black] line-length = 79 [tool.setuptools] -packages = ["prodigy", "prodigy.lib"] +include-package-data = true +packages = ["src"] + +[tool.pytest.ini_options] +pythonpath = ["src"] [build-system] requires = ["poetry-core"] diff --git a/prodigy/__init__.py b/src/prodigy/__init__.py similarity index 100% rename from prodigy/__init__.py rename to src/prodigy/__init__.py diff --git a/prodigy/lib/__init__.py b/src/prodigy/modules/__init__.py similarity index 100% rename from prodigy/lib/__init__.py rename to src/prodigy/modules/__init__.py diff --git a/prodigy/lib/aa_properties.py b/src/prodigy/modules/aa_properties.py similarity index 100% rename from prodigy/lib/aa_properties.py rename to src/prodigy/modules/aa_properties.py diff --git a/prodigy/lib/freesasa_tools.py b/src/prodigy/modules/freesasa_tools.py similarity index 100% rename from prodigy/lib/freesasa_tools.py rename to src/prodigy/modules/freesasa_tools.py diff --git a/prodigy/lib/models.py b/src/prodigy/modules/models.py similarity index 100% rename from prodigy/lib/models.py rename to src/prodigy/modules/models.py diff --git a/prodigy/lib/nis_utils.py b/src/prodigy/modules/nis_utils.py similarity index 100% rename from prodigy/lib/nis_utils.py rename to src/prodigy/modules/nis_utils.py diff --git a/prodigy/lib/parsers.py b/src/prodigy/modules/parsers.py similarity index 100% rename from prodigy/lib/parsers.py rename to src/prodigy/modules/parsers.py diff --git a/prodigy/lib/utils.py b/src/prodigy/modules/utils.py similarity index 100% rename from prodigy/lib/utils.py rename to src/prodigy/modules/utils.py diff --git a/prodigy/naccess.config b/src/prodigy/naccess.config similarity index 100% rename from prodigy/naccess.config rename to src/prodigy/naccess.config diff --git a/prodigy/predict_IC.py b/src/prodigy/predict_IC.py similarity index 98% rename from prodigy/predict_IC.py rename to src/prodigy/predict_IC.py index cd0e50e..df6d708 100644 --- a/prodigy/predict_IC.py +++ b/src/prodigy/predict_IC.py @@ -32,11 +32,11 @@ ) raise ImportError(e) -from .lib import aa_properties -from .lib.freesasa_tools import execute_freesasa_api -from .lib.models import IC_NIS -from .lib.parsers import parse_structure -from .lib.utils import check_path, dg_to_kd +from prodigy.modules import aa_properties +from prodigy.modules.freesasa_tools import execute_freesasa_api +from prodigy.modules.models import IC_NIS +from prodigy.modules.parsers import parse_structure +from prodigy.modules.utils import check_path, dg_to_kd def calculate_ic(struct, d_cutoff=5.5, selection=None): diff --git a/tests/test_prodigy.py b/tests/test_prodigy.py index c859a34..387837c 100644 --- a/tests/test_prodigy.py +++ b/tests/test_prodigy.py @@ -17,8 +17,8 @@ import numpy as np from Bio.PDB import PDBParser, Structure -from prodigy.lib.freesasa_tools import stdchannel_redirected -from prodigy.lib.parsers import validate_structure +from prodigy.modules.freesasa_tools import stdchannel_redirected +from prodigy.modules.parsers import validate_structure from prodigy.predict_IC import Prodigy @@ -66,7 +66,7 @@ def test_dataset(self): handle = dataset.extractfile(entry) # Wrap filehandle to ensure string file handle in Python 3 if version_info[0] >= 3: - handle = TextIOWrapper(BufferedReader(handle)) + handle = TextIOWrapper(BufferedReader(handle)) # type: ignore # Suppress gap warnings when parsing structure with stdchannel_redirected(stderr, devnull): s = validate_structure(