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 @@ ...@@ -12,6 +12,7 @@
stages: stages:
- initial - initial
- test - test
- docs
- deploy - deploy
.test-python: &test-python .test-python: &test-python
...@@ -47,6 +48,8 @@ python-3.7: ...@@ -47,6 +48,8 @@ python-3.7:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python37 image: quay.io/bilbydev/v2-dockerfile-test-suite-python37
script: script:
- python -m pip install . - python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
# Run pyflakes # Run pyflakes
- flake8 . - flake8 .
...@@ -62,12 +65,14 @@ python-3.7: ...@@ -62,12 +65,14 @@ python-3.7:
- htmlcov/ - htmlcov/
docs: docs:
stage: initial stage: docs
image: quay.io/bilbydev/v2-dockerfile-test-suite-python37 image: quay.io/bilbydev/v2-dockerfile-test-suite-python37
script: script:
# Make the documentation # Make the documentation
- apt-get -yqq install pandoc - apt-get -yqq install pandoc
- python -m pip install . - python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
- cd docs - cd docs
- pip install ipykernel ipython jupyter - pip install ipykernel ipython jupyter
- cp ../examples/tutorials/*.ipynb ./ - cp ../examples/tutorials/*.ipynb ./
...@@ -88,6 +93,8 @@ python-3.8: ...@@ -88,6 +93,8 @@ python-3.8:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python38 image: quay.io/bilbydev/v2-dockerfile-test-suite-python38
script: script:
- python -m pip install . - python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
- pytest - pytest
...@@ -97,6 +104,8 @@ python-3.6: ...@@ -97,6 +104,8 @@ python-3.6:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python36 image: quay.io/bilbydev/v2-dockerfile-test-suite-python36
script: script:
- python -m pip install . - python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
- pytest - pytest
...@@ -106,6 +115,8 @@ python-3.7-samplers: ...@@ -106,6 +115,8 @@ python-3.7-samplers:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python37 image: quay.io/bilbydev/v2-dockerfile-test-suite-python37
script: script:
- python -m pip install . - 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/sampler_run_test.py --durations 10
- pytest test/integration/sample_from_the_prior_test.py - pytest test/integration/sample_from_the_prior_test.py
...@@ -116,6 +127,8 @@ python-3.6-samplers: ...@@ -116,6 +127,8 @@ python-3.6-samplers:
image: quay.io/bilbydev/v2-dockerfile-test-suite-python36 image: quay.io/bilbydev/v2-dockerfile-test-suite-python36
script: script:
- python -m pip install . - python -m pip install .
# temporary fix for broken astropy version
- pip install pyerfa==1.7.1.1
- pytest test/integration/sampler_run_test.py - pytest test/integration/sampler_run_test.py
...@@ -138,6 +151,8 @@ scheduled-python-3.7: ...@@ -138,6 +151,8 @@ scheduled-python-3.7:
- schedules - schedules
script: script:
- python -m pip install . - 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 # Run tests which are only done on schedule
- pytest test/integration/example_test.py - pytest test/integration/example_test.py
......
...@@ -21,7 +21,7 @@ for line in lines: ...@@ -21,7 +21,7 @@ for line in lines:
for element in line.split()[1:]: for element in line.split()[1:]:
element = element.lower() element = element.lower()
if element not in AUTHORS_list and element not in special_cases: 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 fail_test += True
if fail_test: if fail_test:
......
import unittest import unittest
import pytest
import sys
from mock import MagicMock from mock import MagicMock
import bilby import bilby
@pytest.mark.skipif(sys.version_info[1] <= 6, reason="pymc3 is broken in py36")
class TestPyMC3(unittest.TestCase): class TestPyMC3(unittest.TestCase):
def setUp(self): def setUp(self):
self.likelihood = MagicMock() self.likelihood = MagicMock()
......
import bilby
import unittest import unittest
import numpy as np import pytest
import shutil import shutil
import sys
import bilby
import numpy as np
class TestRunningSamplers(unittest.TestCase): class TestRunningSamplers(unittest.TestCase):
...@@ -103,6 +106,7 @@ class TestRunningSamplers(unittest.TestCase): ...@@ -103,6 +106,7 @@ class TestRunningSamplers(unittest.TestCase):
) )
def test_run_pypolychord(self): def test_run_pypolychord(self):
pytest.importorskip("pypolychord")
_ = bilby.run_sampler( _ = bilby.run_sampler(
likelihood=self.likelihood, likelihood=self.likelihood,
priors=self.priors, priors=self.priors,
...@@ -124,6 +128,7 @@ class TestRunningSamplers(unittest.TestCase): ...@@ -124,6 +128,7 @@ class TestRunningSamplers(unittest.TestCase):
save=False, save=False,
) )
@pytest.mark.skipif(sys.version_info[1] <= 6, reason="pymc3 is broken in py36")
def test_run_pymc3(self): def test_run_pymc3(self):
_ = bilby.run_sampler( _ = bilby.run_sampler(
likelihood=self.likelihood, 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