Skip to content

Commit

Permalink
Re organize repository (#34)
Browse files Browse the repository at this point in the history
* re-organize repository

* Add .vscode/ to .gitignore

* update pyproject.toml

* update ci.yml

* update ci.yml

* typo

* update action
  • Loading branch information
rvhonorato authored Apr 26, 2024
1 parent ad193a4 commit cb1f282
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 42 deletions.
33 changes: 4 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,28 @@ 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:
version: 1.3.2
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
#.idea/

.vscode/
poetry.lock
15 changes: 11 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions prodigy/predict_IC.py → src/prodigy/predict_IC.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_prodigy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit cb1f282

Please sign in to comment.