Skip to content

Commit

Permalink
added wkhtmltopdf to CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
iskandr committed Feb 14, 2024
1 parent dd7ee16 commit 58695cd
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov pylint
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install wkthtmltopdf
run: |
sudo apt-get install -y xfonts-base xfonts-75dpi
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ To install Vaxrank for local development, you may do the below:

```
git clone git@github.com:openvax/vaxrank.git
conda create -q -n vaxrank-dev-env python=3.5.2 numpy scipy nose pandas pylint
conda create -q -n vaxrank-dev-env python=3.5.2 numpy scipy pandas pylint
source activate vaxrank-dev-env
pip install -r requirements.txt
pip install .
Expand All @@ -86,8 +86,7 @@ pyensembl install --release 87 --species mouse
You should run the linter and the test suite as you work on Vaxrank (and these will be run automatically by our continuous integration server up on a PR being made).

```
./lint.sh
nosetests test
./lint.sh && ./test.sh
```

The first run of the tests may take a while (8 minutes on a 2016 Macbook Pro) to create the FM index of the proteome, but subsequent tests should take only a few seconds.
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cancer_driver_gene.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
_DRIVER_VARIANT_COLUMN_NAME
)
from varcode import Variant
from nose.tools import eq_

from .common import eq_


def test_HRAS_G13C_in_cancer_driver_genes():
Expand Down
6 changes: 2 additions & 4 deletions tests/test_epitope_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import, print_function, division

from nose.tools import eq_, ok_

from mhctools import RandomBindingPredictor
from pyensembl import genome_for_reference_name
from varcode import Variant
from vaxrank.epitope_prediction import predict_epitopes, EpitopePrediction
from vaxrank.mutant_protein_fragment import MutantProteinFragment
from vaxrank.vaccine_peptide import VaccinePeptide

from .common import eq_, ok_

mouse_genome = genome_for_reference_name("GRCm38")

def test_reference_peptide_logic():
Expand Down
1 change: 0 additions & 1 deletion tests/test_manufacturability.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from vaxrank.manufacturability import ManufacturabilityScores


def test_c_terminal_proline():
scores = ManufacturabilityScores.from_amino_acids("A" * 6 + "P")
assert scores.c_terminal_proline
Expand Down
7 changes: 3 additions & 4 deletions tests/test_mutant_protein_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import, print_function, division
from mhctools import RandomBindingPredictor

from nose.tools import eq_, assert_almost_equal
from vaxrank.cli import make_vaxrank_arg_parser, run_vaxrank_from_parsed_args
from vaxrank.mutant_protein_fragment import MutantProteinFragment
from mhctools import RandomBindingPredictor

from .common import eq_, almost_eq_
from .testing_helpers import data_path

random_binding_predictor = RandomBindingPredictor(["H-2-Kb", "H-2-Db"])
Expand Down Expand Up @@ -119,7 +118,7 @@ def test_keep_top_k_epitopes():
# propagated as expected
mutant_epitope_score = sum(
p.logistic_epitope_score() for p in vaccine_peptide.mutant_epitope_predictions)
assert_almost_equal(mutant_epitope_score, vaccine_peptide.mutant_epitope_score)
almost_eq_(mutant_epitope_score, vaccine_peptide.mutant_epitope_score)

def test_mutant_protein_fragment_serialization():
arg_parser = make_vaxrank_arg_parser()
Expand Down
7 changes: 1 addition & 6 deletions tests/test_shell_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from os.path import getsize
from mock import patch
from nose.plugins.attrib import attr

from tempfile import NamedTemporaryFile

import pandas as pd
Expand Down Expand Up @@ -129,7 +129,6 @@ def test_html_report():
assert len(lines) > 1


@attr('skip') # want the ability to skip this test on some machines
def test_pdf_report():
with NamedTemporaryFile(mode="rb") as f:
pdf_args = cli_args_for_b16_seqdata + ["--output-pdf-report", f.name]
Expand All @@ -148,7 +147,3 @@ def test_report_no_peptides(mock_vaccine_peptides_for_variant):
contents = f.read()
assert contents == ''


if __name__ == "__main__":
test_csv_report()
test_html_report()
2 changes: 1 addition & 1 deletion vaxrank/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
extensions=[],
autoescape=False,
trim_blocks=True,
lstrip_blocks=True,
Expand Down

0 comments on commit 58695cd

Please sign in to comment.