Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update astropy-helpers to v3.2.1 #415

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ matrix:
# Try without using statsmodels
- env: PYTHON_VERSION=3.5 PIP_DEPENDENCIES='emcee'

- env: PYTHON_VERSION=3.6 PIP_DEPENDENCIES='nbsphinx' SETUP_CMD='build_docs -w'
- env: PYTHON_VERSION=3.6 PIP_DEPENDENCIES='nbsphinx sphinx-astropy' SETUP_CMD='build_docs -w'

# Try Astropy development version
- env: PYTHON_VERSION=3.7 ASTROPY_VERSION=development
Expand Down
32 changes: 16 additions & 16 deletions ah_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@
from distutils import log
from distutils.debug import DEBUG

try:
from ConfigParser import ConfigParser, RawConfigParser
except ImportError:
from configparser import ConfigParser, RawConfigParser
from configparser import ConfigParser, RawConfigParser

import pkg_resources

Expand Down Expand Up @@ -119,24 +116,27 @@

# We want the Python version as a string, which we can get from the platform module
import platform
python_version = platform.python_version()

if not req.specifier.contains(python_version):
# strip off trailing '+' incase this is a dev install of python
python_version = platform.python_version().strip('+')
# allow pre-releases to count as 'new enough'
if not req.specifier.contains(python_version, True):
if parent_package is None:
print("ERROR: Python {} is required by this package".format(req.specifier))
message = "ERROR: Python {} is required by this package\n".format(req.specifier)
else:
print("ERROR: Python {} is required by {}".format(req.specifier, parent_package))
message = "ERROR: Python {} is required by {}\n".format(req.specifier, parent_package)
sys.stderr.write(message)
sys.exit(1)

if sys.version_info < __minimum_python_version__:

if parent_package is None:
print("ERROR: Python {} or later is required by astropy-helpers".format(
__minimum_python_version__))
message = "ERROR: Python {} or later is required by astropy-helpers\n".format(
__minimum_python_version__)
else:
print("ERROR: Python {} or later is required by astropy-helpers for {}".format(
__minimum_python_version__, parent_package))
message = "ERROR: Python {} or later is required by astropy-helpers for {}\n".format(
__minimum_python_version__, parent_package)

sys.stderr.write(message)
sys.exit(1)

_str_types = (str, bytes)
Expand All @@ -146,14 +146,14 @@
# issues with either missing or misbehaving pacakges (including making sure
# setuptools itself is installed):

# Check that setuptools 1.0 or later is present
# Check that setuptools 30.3 or later is present
from distutils.version import LooseVersion

try:
import setuptools
assert LooseVersion(setuptools.__version__) >= LooseVersion('1.0')
assert LooseVersion(setuptools.__version__) >= LooseVersion('30.3')
except (ImportError, AssertionError):
print("ERROR: setuptools 1.0 or later is required by astropy-helpers")
sys.stderr.write("ERROR: setuptools 30.3 or later is required by astropy-helpers\n")
sys.exit(1)

# typing as a dependency for 1.6.1+ Sphinx causes issues when imported after
Expand Down
13 changes: 12 additions & 1 deletion stingray/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.

from astropy.tests.pytest_plugins import *
from astropy.version import version as astropy_version
if astropy_version < '3.0':
# With older versions of Astropy, we actually need to import the pytest
# plugins themselves in order to make them discoverable by pytest.
from astropy.tests.pytest_plugins import *
else:
# As of Astropy 3.0, the pytest plugins provided by Astropy are
# automatically made available when Astropy is installed. This means it's
# not necessary to import them here, but we still need to import global
# variables that are used for configuration.
from astropy.tests.plugins.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS
from astropy.tests.helper import enable_deprecations_as_exceptions

## Uncomment the following line to treat all DeprecationWarnings as
## exceptions
Expand Down