Commit b02f7bc1 authored by Ole Streicher's avatar Ole Streicher

New upstream version 3.1.1

parent 75208ebd
astropy-helpers Changelog
*************************
3.1.1 (2019-02-22)
------------------
- Moved documentation from README to Sphinx. [#444]
- Fixed broken OpenMP detection when building with ``-coverage``. [#434]
3.1 (2018-12-04)
----------------
......@@ -52,6 +61,17 @@ astropy-helpers Changelog
with twine and get registered automatically. [#332]
2.0.9 (2019-02-22)
------------------
- Updated bundled version of sphinx-automodapi to v0.10. [#439]
- Updated bundled sphinx extensions version to sphinx-astropy v1.1.1. [#454]
- Include package name in error message for Python version in
``ah_bootstrap.py``. [#441]
2.0.8 (2018-12-04)
------------------
......
This diff is collapsed.
This diff is collapsed.
......@@ -45,18 +45,99 @@ import re
import subprocess as sp
import sys
__minimum_python_version__ = (3, 5)
if sys.version_info < __minimum_python_version__:
print("ERROR: Python {} or later is required by astropy-helpers".format(
__minimum_python_version__))
sys.exit(1)
from distutils import log
from distutils.debug import DEBUG
try:
from ConfigParser import ConfigParser, RawConfigParser
except ImportError:
from configparser import ConfigParser, RawConfigParser
import pkg_resources
from setuptools import Distribution
from setuptools.package_index import PackageIndex
# This is the minimum Python version required for astropy-helpers
__minimum_python_version__ = (3, 5)
# TODO: Maybe enable checking for a specific version of astropy_helpers?
DIST_NAME = 'astropy-helpers'
PACKAGE_NAME = 'astropy_helpers'
UPPER_VERSION_EXCLUSIVE = None
# Defaults for other options
DOWNLOAD_IF_NEEDED = True
INDEX_URL = 'https://pypi.python.org/simple'
USE_GIT = True
OFFLINE = False
AUTO_UPGRADE = True
# A list of all the configuration options and their required types
CFG_OPTIONS = [
('auto_use', bool), ('path', str), ('download_if_needed', bool),
('index_url', str), ('use_git', bool), ('offline', bool),
('auto_upgrade', bool)
]
# Start off by parsing the setup.cfg file
SETUP_CFG = ConfigParser()
if os.path.exists('setup.cfg'):
try:
SETUP_CFG.read('setup.cfg')
except Exception as e:
if DEBUG:
raise
log.error(
"Error reading setup.cfg: {0!r}\n{1} will not be "
"automatically bootstrapped and package installation may fail."
"\n{2}".format(e, PACKAGE_NAME, _err_help_msg))
# We used package_name in the package template for a while instead of name
if SETUP_CFG.has_option('metadata', 'name'):
parent_package = SETUP_CFG.get('metadata', 'name')
elif SETUP_CFG.has_option('metadata', 'package_name'):
parent_package = SETUP_CFG.get('metadata', 'package_name')
else:
parent_package = None
if SETUP_CFG.has_option('options', 'python_requires'):
python_requires = SETUP_CFG.get('options', 'python_requires')
# The python_requires key has a syntax that can be parsed by SpecifierSet
# in the packaging package. However, we don't want to have to depend on that
# package, so instead we can use setuptools (which bundles packaging). We
# have to add 'python' to parse it with Requirement.
from pkg_resources import Requirement
req = Requirement.parse('python' + python_requires)
# 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):
if parent_package is None:
print("ERROR: Python {} is required by this package".format(req.specifier))
else:
print("ERROR: Python {} is required by {}".format(req.specifier, parent_package))
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__))
else:
print("ERROR: Python {} or later is required by astropy-helpers for {}".format(
__minimum_python_version__, parent_package))
sys.exit(1)
_str_types = (str, bytes)
......@@ -116,36 +197,6 @@ except:
# End compatibility imports...
# In case it didn't successfully import before the ez_setup checks
import pkg_resources
from setuptools import Distribution
from setuptools.package_index import PackageIndex
from distutils import log
from distutils.debug import DEBUG
# TODO: Maybe enable checking for a specific version of astropy_helpers?
DIST_NAME = 'astropy-helpers'
PACKAGE_NAME = 'astropy_helpers'
UPPER_VERSION_EXCLUSIVE = None
# Defaults for other options
DOWNLOAD_IF_NEEDED = True
INDEX_URL = 'https://pypi.python.org/simple'
USE_GIT = True
OFFLINE = False
AUTO_UPGRADE = True
# A list of all the configuration options and their required types
CFG_OPTIONS = [
('auto_use', bool), ('path', str), ('download_if_needed', bool),
('index_url', str), ('use_git', bool), ('offline', bool),
('auto_upgrade', bool)
]
class _Bootstrapper(object):
"""
Bootstrapper implementation. See ``use_astropy_helpers`` for parameter
......@@ -215,36 +266,20 @@ class _Bootstrapper(object):
@classmethod
def parse_config(cls):
if not os.path.exists('setup.cfg'):
return {}
cfg = ConfigParser()
try:
cfg.read('setup.cfg')
except Exception as e:
if DEBUG:
raise
log.error(
"Error reading setup.cfg: {0!r}\n{1} will not be "
"automatically bootstrapped and package installation may fail."
"\n{2}".format(e, PACKAGE_NAME, _err_help_msg))
return {}
if not cfg.has_section('ah_bootstrap'):
if not SETUP_CFG.has_section('ah_bootstrap'):
return {}
config = {}
for option, type_ in CFG_OPTIONS:
if not cfg.has_option('ah_bootstrap', option):
if not SETUP_CFG.has_option('ah_bootstrap', option):
continue
if type_ is bool:
value = cfg.getboolean('ah_bootstrap', option)
value = SETUP_CFG.getboolean('ah_bootstrap', option)
else:
value = cfg.get('ah_bootstrap', option)
value = SETUP_CFG.get('ah_bootstrap', option)
config[option] = value
......@@ -633,8 +668,8 @@ class _Bootstrapper(object):
# only if the submodule is initialized. We ignore this information for
# now
_git_submodule_status_re = re.compile(
'^(?P<status>[+-U ])(?P<commit>[0-9a-f]{40}) '
'(?P<submodule>\S+)( .*)?$')
r'^(?P<status>[+-U ])(?P<commit>[0-9a-f]{40}) '
r'(?P<submodule>\S+)( .*)?$')
# The stdout should only contain one line--the status of the
# requested submodule
......
......@@ -15,6 +15,8 @@ import os
import subprocess
import warnings
__all__ = ['get_git_devstr']
def _decode_stdio(stream):
try:
......
......@@ -26,7 +26,7 @@ from distutils.ccompiler import new_compiler
from distutils.sysconfig import customize_compiler, get_config_var
from distutils.errors import CompileError, LinkError
from .setup_helpers import get_compiler_option
from .distutils_helpers import get_compiler_option
__all__ = ['add_openmp_flags_if_available']
......@@ -176,6 +176,11 @@ def check_openmp_support(openmp_flags=None):
compile_flags = openmp_flags.get('compiler_flags')
link_flags = openmp_flags.get('linker_flags')
# Pass -coverage flag to linker.
# https://github.com/astropy/astropy-helpers/pull/374
if '-coverage' in compile_flags and '-coverage' not in link_flags:
link_flags.append('-coverage')
tmp_dir = tempfile.mkdtemp()
start_dir = os.path.abspath('.')
......
......@@ -37,6 +37,8 @@ from .commands.test import AstropyTest
from .utils import get_numpy_include_path, write_if_different # noqa
from .commands.build_ext import should_build_with_cython, get_compiler_version # noqa
__all__ = ['register_commands', 'get_package_info']
_module_state = {'registered_commands': None,
'have_sphinx': False,
'package_cache': None,
......@@ -344,9 +346,6 @@ def get_package_info(srcdir='.', exclude=()):
- ``get_external_libraries()`` returns
a list of libraries that can optionally be built using external
dependencies.
- ``get_entry_points()`` returns a dict formatted as required by
the ``entry_points`` argument to ``setup()``.
"""
ext_modules = []
packages = []
......
# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2018-12-05 02:20:30 UTC
# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2019-02-23 06:39:22 UTC
from __future__ import unicode_literals
import datetime
version = "3.1"
githash = "9f82aac6c2141b425e2d639560f7260189d90b54"
version = "3.1.1"
githash = "79c3c01af3c436963f275e0f9e7dd3ac0625d70d"
major = 3
minor = 1
bugfix = 0
bugfix = 1
version_info = (major, minor, bugfix)
release = True
timestamp = datetime.datetime(2018, 12, 5, 2, 20, 30)
timestamp = datetime.datetime(2019, 2, 23, 6, 39, 22)
debug = False
astropy_helpers_version = ""
......
......@@ -35,6 +35,8 @@ import pkg_resources
from . import git_helpers
from .distutils_helpers import is_distutils_display_option
__all__ = ['generate_version_py']
def _version_split(version):
"""
......
......@@ -9,7 +9,7 @@ from astropy_helpers.setup_helpers import (register_commands, get_package_info,
from astropy_helpers.version_helpers import generate_version_py
NAME = 'astropy_helpers'
VERSION = '3.1'
VERSION = '3.1.1'
RELEASE = 'dev' not in VERSION
generate_version_py(NAME, VERSION, RELEASE, False, uses_git=not RELEASE)
......@@ -46,6 +46,7 @@ setup(
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Archiving :: Packaging'
],
extras_require={'docs': ['sphinx-astropy']},
cmdclass=cmdclass,
python_requires='>=3.5',
zip_safe=False,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment