From bfd28106d3e6eb6d9da3f35cdbc75f1da990a695 Mon Sep 17 00:00:00 2001 From: MSeifert04 Date: Sun, 24 Nov 2019 14:18:40 +0100 Subject: [PATCH 1/3] Increment old numpy versions (experimental) --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ebdfa2c..702dad42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,15 +61,15 @@ matrix: SETUP_CMD='test --coverage' # Check compatibility with the current astropy LTS release - - python: 3.6 - env: ASTROPY_VERSION=2 + - env: ASTROPY_VERSION=2 PYTEST_VERSION=3.6 + PYTHON_VERSION=3.6 - - python: 3.5 - env: NUMPY_VERSION=1.13 + - env: NUMPY_VERSION=1.14 + PYTHON_VERSION=3.5 - - python: 3.6 - env: NUMPY_VERSION=1.14 + - env: NUMPY_VERSION=1.15 + PYTHON_VERSION=3.6 # Try numpy pre-release version. This runs only when a pre-release # is available on pypi. From 525996bff158af038cef9e90479c528a3b39ded1 Mon Sep 17 00:00:00 2001 From: Brigitta Sipocz Date: Tue, 19 Nov 2019 15:47:21 -0800 Subject: [PATCH 2/3] Fixing header plugin --- ccdproc/conftest.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ccdproc/conftest.py b/ccdproc/conftest.py index 5c4614c2..239a5e10 100644 --- a/ccdproc/conftest.py +++ b/ccdproc/conftest.py @@ -6,15 +6,11 @@ import os -try: - from astropy.tests.plugins.display import (pytest_report_header, - PYTEST_HEADER_MODULES, - TESTED_VERSIONS) -except ImportError: - # When using astropy 2.0 - from astropy.tests.pytest_plugins import (pytest_report_header, - PYTEST_HEADER_MODULES, - TESTED_VERSIONS) +from pytest_astropy_header.display import (PYTEST_HEADER_MODULES, + TESTED_VERSIONS) + +def pytest_configure(config): + config.option.astropy_header = True try: # This is the way to get plugins in astropy 2.x From 773c95a812750753799ef591368629bcf5256eb4 Mon Sep 17 00:00:00 2001 From: MSeifert04 Date: Sun, 24 Nov 2019 16:29:59 +0100 Subject: [PATCH 3/3] keep the old ways of getting the pytest-header for now. --- ccdproc/conftest.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/ccdproc/conftest.py b/ccdproc/conftest.py index 239a5e10..9a9f969d 100644 --- a/ccdproc/conftest.py +++ b/ccdproc/conftest.py @@ -6,13 +6,30 @@ import os -from pytest_astropy_header.display import (PYTEST_HEADER_MODULES, - TESTED_VERSIONS) +try: + # When the pytest_astropy_header package is installed + from pytest_astropy_header.display import (PYTEST_HEADER_MODULES, + TESTED_VERSIONS) -def pytest_configure(config): - config.option.astropy_header = True + def pytest_configure(config): + config.option.astropy_header = True +except ImportError: + # TODO: Remove this when astropy 2.x and 3.x support is dropped. + # Probably an old pytest-astropy package where the pytest_astropy_header + # is not a dependency. + try: + from astropy.tests.plugins.display import (pytest_report_header, + PYTEST_HEADER_MODULES, + TESTED_VERSIONS) + except ImportError: + # TODO: Remove this when astropy 2.x support is dropped. + # If that also did not work we're probably using astropy 2.0 + from astropy.tests.pytest_plugins import (pytest_report_header, + PYTEST_HEADER_MODULES, + TESTED_VERSIONS) try: + # TODO: Remove this when astropy 2.x support is dropped. # This is the way to get plugins in astropy 2.x from astropy.tests.pytest_plugins import * except ImportError: