Changes to make build independent of version of astropy

Should still work:


mimsy:~ bsimon$ python

Python 2.7.5 (default, Dec  2 2013, 16:07:04)

[GCC 4.2.1 (Apple Inc. build 5664)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> '1.10' >= '0.4'

True

But I will look at revising it.

From: Michael Droettboom <notifications@github.com<mailto:notifications@github.com>>
Reply-To: spacetelescope/sphere <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Tuesday, July 22, 2014 at 3:55 PM
To: spacetelescope/sphere <sphere@noreply.github.com<mailto:sphere@noreply.github.com>>
Cc: Bernard Simon <bsimon@stsci.edu<mailto:bsimon@stsci.edu>>
Subject: Re: [sphere] Changes to make build independent of version of astropy (#36)


In stsci_sphere/_astropy_init.py:

> @@ -104,11 +104,19 @@ def test(package=None, test_path=None, args=None, plugins=None,
>
>      """
>      test_runner = _get_test_runner()
> -    return test_runner.run_tests(
> -        package=package, test_path=test_path, args=args,
> -        plugins=plugins, verbose=verbose, pastebin=pastebin,
> -        remote_data=remote_data, pep8=pep8, pdb=pdb,
> -        coverage=coverage, open_files=open_files, **kwargs)
> +    from astropy.version import _last_generated_version


This refers to the last version that was generated, not the installed version (@embray<https://github.com/embray> can tell you for certain). I think you want:

from astropy import __version__


The string comparison is probably fine for now, but it will fail if there's ever an astropy 1.10. The usual way to handle this is to use the distutils.version module, which has utilities for comparing version strings.

—
Reply to this email directly or view it on GitHub<https://github.com/spacetelescope/sphere/pull/36/files#r15251755>.