Skip to content
Snippets Groups Projects
Commit 41717c91 authored by Colm Talbot's avatar Colm Talbot
Browse files

Fix ci

parent 6681ce04
No related branches found
No related tags found
1 merge request!922Fix ci
......@@ -12,6 +12,7 @@
stages:
- initial
- test
- docs
- deploy
.test-python: &test-python
......@@ -47,6 +48,8 @@ python-3.7:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python37
script:
- python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
# Run pyflakes
- flake8 .
......@@ -62,12 +65,14 @@ python-3.7:
- htmlcov/
docs:
stage: initial
stage: docs
image: quay.io/bilbydev/v2-dockerfile-test-suite-python37
script:
# Make the documentation
- apt-get -yqq install pandoc
- python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
- cd docs
- pip install ipykernel ipython jupyter
- cp ../examples/tutorials/*.ipynb ./
......@@ -88,6 +93,8 @@ python-3.8:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python38
script:
- python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
- pytest
......@@ -97,6 +104,8 @@ python-3.6:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python36
script:
- python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
- pytest
......@@ -106,6 +115,8 @@ python-3.7-samplers:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python37
script:
- python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
- pytest test/integration/sampler_run_test.py --durations 10
- pytest test/integration/sample_from_the_prior_test.py
......@@ -116,6 +127,8 @@ python-3.6-samplers:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python36
script:
- python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
- pytest test/integration/sampler_run_test.py
......@@ -138,6 +151,8 @@ scheduled-python-3.7:
- schedules
script:
- python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
# Run tests which are only done on schedule
- pytest test/integration/example_test.py
......
......@@ -21,7 +21,7 @@ for line in lines:
for element in line.split()[1:]:
element = element.lower()
if element not in AUTHORS_list and element not in special_cases:
print("Failure: {} not in AUTHOR.md".format(element))
print(f"Failure: {element} not in AUTHOR.md")
fail_test += True
if fail_test:
......
import unittest
import pytest
import sys
from mock import MagicMock
import bilby
@pytest.mark.skipif(sys.version_info[1] <= 6, reason="pymc3 is broken in py36")
class TestPyMC3(unittest.TestCase):
def setUp(self):
self.likelihood = MagicMock()
......
import bilby
import unittest
import numpy as np
import pytest
import shutil
import sys
import bilby
import numpy as np
class TestRunningSamplers(unittest.TestCase):
......@@ -103,6 +106,7 @@ class TestRunningSamplers(unittest.TestCase):
)
def test_run_pypolychord(self):
pytest.importorskip("pypolychord")
_ = bilby.run_sampler(
likelihood=self.likelihood,
priors=self.priors,
......@@ -124,6 +128,7 @@ class TestRunningSamplers(unittest.TestCase):
save=False,
)
@pytest.mark.skipif(sys.version_info[1] <= 6, reason="pymc3 is broken in py36")
def test_run_pymc3(self):
_ = bilby.run_sampler(
likelihood=self.likelihood,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment