Skip to content

Update template files #1

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

Merged
merged 10 commits into from
May 3, 2018
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
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ __pycache__
*.c

# Other generated files
*/version.py
*/cython_version.py
htmlcov
.coverage
MANIFEST
astropy/version.py
astropy/cython_version.py
astropy/wcs/include/wcsconfig.h
astropy/_erfa/core.py
astropy/_erfa/core.pyx
.ipynb_checkpoints

# Sphinx
_build
Expand Down
12 changes: 12 additions & 0 deletions .rtd-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: packagename

channels:
- astropy

dependencies:
- astropy
- Cython
- matplotlib
- numpy
# - pip:
# - dependency_from_pip
26 changes: 2 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ env:

matrix:
# Make sure that egg_info works without dependencies
- PYTHON_VERSION=2.7 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.3 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.4 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.5 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.6 SETUP_CMD='egg_info'

Expand All @@ -78,34 +75,15 @@ matrix:
- os: linux
env: SETUP_CMD='build_docs -w'

# Now try Astropy dev and LTS vesions with the latest 3.x and 2.7.
- os: linux
env: PYTHON_VERSION=2.7 ASTROPY_VERSION=development
EVENT_TYPE='pull_request push cron'
# Now try Astropy dev and LTS vesions with the latest 3.x and 3.(x-1).
- os: linux
env: ASTROPY_VERSION=development
EVENT_TYPE='pull_request push cron'
- os: linux
env: PYTHON_VERSION=2.7 ASTROPY_VERSION=lts
env: PYTHON_VERSION=3.5 ASTROPY_VERSION=lts
- os: linux
env: ASTROPY_VERSION=lts

# Try all python versions and Numpy versions. Since we can assume that
# the Numpy developers have taken care of testing Numpy with different
# versions of Python, we can vary Python and Numpy versions at the same
# time.

- os: linux
env: PYTHON_VERSION=2.7 NUMPY_VERSION=1.7
- os: linux
env: PYTHON_VERSION=3.3 NUMPY_VERSION=1.8
- os: linux
env: PYTHON_VERSION=3.4 NUMPY_VERSION=1.9
- os: linux
env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.10
- os: linux
env: NUMPY_VERSION=1.11

# Try numpy pre-release
- os: linux
env: NUMPY_VERSION=prerelease
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# specreduce
Specreduce
=========

Providing tools necessary to facillitate spectroscopic reduction pipelines.
.. image:: https://travis-ci.org/astropy/specutils.svg?branch=master
:target: https://travis-ci.org/astropy/specutils

.. image:: https://readthedocs.org/projects/specutils/badge/?version=latest
:target: http://specutils.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
:target: http://www.astropy.org/

Specreduce is an Astropy affiliated package with the goal of providing a shared
set of Python utilities that can be used to reduce and calibrate spectroscopic data.

License
-------

Specreduce is licensed under a 3-clause BSD style license. Please see the LICENSE.rst file.
125 changes: 69 additions & 56 deletions ah_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
contains an option called ``auto_use`` with a value of ``True``, it will
automatically call the main function of this module called
`use_astropy_helpers` (see that function's docstring for full details).
Otherwise no further action is taken (however,
``ah_bootstrap.use_astropy_helpers`` may be called manually from within the
setup.py script).
Otherwise no further action is taken and by default the system-installed version
of astropy-helpers will be used (however, ``ah_bootstrap.use_astropy_helpers``
may be called manually from within the setup.py script).

This behavior can also be controlled using the ``--auto-use`` and
``--no-auto-use`` command-line flags. For clarity, an alias for
``--no-auto-use`` is ``--use-system-astropy-helpers``, and we recommend using
the latter if needed.

Additional options in the ``[ah_boostrap]`` section of setup.cfg have the same
names as the arguments to `use_astropy_helpers`, and can be used to configure
Expand Down Expand Up @@ -91,13 +96,24 @@
use_setuptools()


# typing as a dependency for 1.6.1+ Sphinx causes issues when imported after
# initializing submodule with ah_boostrap.py
# See discussion and references in
# https://github.com/astropy/astropy-helpers/issues/302

try:
import typing # noqa
except ImportError:
pass


# Note: The following import is required as a workaround to
# https://github.com/astropy/astropy-helpers/issues/89; if we don't import this
# module now, it will get cleaned up after `run_setup` is called, but that will
# later cause the TemporaryDirectory class defined in it to stop working when
# used later on by setuptools
try:
import setuptools.py31compat
import setuptools.py31compat # noqa
except ImportError:
pass

Expand Down Expand Up @@ -126,7 +142,6 @@

from setuptools import Distribution
from setuptools.package_index import PackageIndex
from setuptools.sandbox import run_setup

from distutils import log
from distutils.debug import DEBUG
Expand All @@ -136,6 +151,11 @@
DIST_NAME = 'astropy-helpers'
PACKAGE_NAME = 'astropy_helpers'

if PY3:
UPPER_VERSION_EXCLUSIVE = None
else:
UPPER_VERSION_EXCLUSIVE = '3'

# Defaults for other options
DOWNLOAD_IF_NEEDED = True
INDEX_URL = 'https://pypi.python.org/simple'
Expand Down Expand Up @@ -276,6 +296,18 @@ def parse_command_line(cls, argv=None):
config['offline'] = True
argv.remove('--offline')

if '--auto-use' in argv:
config['auto_use'] = True
argv.remove('--auto-use')

if '--no-auto-use' in argv:
config['auto_use'] = False
argv.remove('--no-auto-use')

if '--use-system-astropy-helpers' in argv:
config['auto_use'] = False
argv.remove('--use-system-astropy-helpers')

return config

def run(self):
Expand Down Expand Up @@ -453,9 +485,10 @@ def _directory_import(self):
# setup.py exists we can generate it
setup_py = os.path.join(path, 'setup.py')
if os.path.isfile(setup_py):
with _silence():
run_setup(os.path.join(path, 'setup.py'),
['egg_info'])
# We use subprocess instead of run_setup from setuptools to
# avoid segmentation faults - see the following for more details:
# https://github.com/cython/cython/issues/2104
sp.check_output([sys.executable, 'setup.py', 'egg_info'], cwd=path)

for dist in pkg_resources.find_distributions(path, True):
# There should be only one...
Expand Down Expand Up @@ -490,16 +523,32 @@ def get_option_dict(self, command_name):
if version:
req = '{0}=={1}'.format(DIST_NAME, version)
else:
req = DIST_NAME
if UPPER_VERSION_EXCLUSIVE is None:
req = DIST_NAME
else:
req = '{0}<{1}'.format(DIST_NAME, UPPER_VERSION_EXCLUSIVE)

attrs = {'setup_requires': [req]}

# NOTE: we need to parse the config file (e.g. setup.cfg) to make sure
# it honours the options set in the [easy_install] section, and we need
# to explicitly fetch the requirement eggs as setup_requires does not
# get honored in recent versions of setuptools:
# https://github.com/pypa/setuptools/issues/1273

try:
if DEBUG:
_Distribution(attrs=attrs)
else:
with _silence():
_Distribution(attrs=attrs)

context = _verbose if DEBUG else _silence
with context():
dist = _Distribution(attrs=attrs)
try:
dist.parse_config_files(ignore_option_errors=True)
dist.fetch_build_eggs(req)
except TypeError:
# On older versions of setuptools, ignore_option_errors
# doesn't exist, and the above two lines are not needed
# so we can just continue
pass

# If the setup_requires succeeded it will have added the new dist to
# the main working_set
Expand Down Expand Up @@ -702,7 +751,7 @@ def _update_submodule(self, submodule, status):
if self.offline:
cmd.append('--no-fetch')
elif status == 'U':
raise _AHBoostrapSystemExit(
raise _AHBootstrapSystemExit(
'Error: Submodule {0} contains unresolved merge conflicts. '
'Please complete or abandon any changes in the submodule so that '
'it is in a usable state, then try again.'.format(submodule))
Expand Down Expand Up @@ -763,7 +812,7 @@ def run_cmd(cmd):
msg = 'Command not found: `{0}`'.format(' '.join(cmd))
raise _CommandNotFound(msg, cmd)
else:
raise _AHBoostrapSystemExit(
raise _AHBootstrapSystemExit(
'An unexpected error occurred when running the '
'`{0}` command:\n{1}'.format(' '.join(cmd), str(e)))

Expand Down Expand Up @@ -835,6 +884,10 @@ def flush(self):
pass


@contextlib.contextmanager
def _verbose():
yield

@contextlib.contextmanager
def _silence():
"""A context manager that silences sys.stdout and sys.stderr."""
Expand Down Expand Up @@ -878,46 +931,6 @@ def __init__(self, *args):
super(_AHBootstrapSystemExit, self).__init__(msg, *args[1:])


if sys.version_info[:2] < (2, 7):
# In Python 2.6 the distutils log does not log warnings, errors, etc. to
# stderr so we have to wrap it to ensure consistency at least in this
# module
import distutils

class log(object):
def __getattr__(self, attr):
return getattr(distutils.log, attr)

def warn(self, msg, *args):
self._log_to_stderr(distutils.log.WARN, msg, *args)

def error(self, msg):
self._log_to_stderr(distutils.log.ERROR, msg, *args)

def fatal(self, msg):
self._log_to_stderr(distutils.log.FATAL, msg, *args)

def log(self, level, msg, *args):
if level in (distutils.log.WARN, distutils.log.ERROR,
distutils.log.FATAL):
self._log_to_stderr(level, msg, *args)
else:
distutils.log.log(level, msg, *args)

def _log_to_stderr(self, level, msg, *args):
# This is the only truly 'public' way to get the current threshold
# of the log
current_threshold = distutils.log.set_threshold(distutils.log.WARN)
distutils.log.set_threshold(current_threshold)
if level >= current_threshold:
if args:
msg = msg % args
sys.stderr.write('%s\n' % msg)
sys.stderr.flush()

log = log()


BOOTSTRAPPER = _Bootstrapper.main()


Expand Down
2 changes: 1 addition & 1 deletion astropy_helpers
Submodule astropy_helpers updated 78 files
+33 −32 .travis.yml
+138 −11 CHANGES.rst
+11 −18 README.rst
+82 −94 ah_bootstrap.py
+5 −9 appveyor.yml
+1 −4 astropy_helpers/__init__.py
+2 −10 astropy_helpers/commands/_dummy.py
+0 −307 astropy_helpers/commands/_test_compat.py
+3 −3 astropy_helpers/commands/build_ext.py
+0 −39 astropy_helpers/commands/build_py.py
+45 −11 astropy_helpers/commands/build_sphinx.py
+0 −14 astropy_helpers/commands/install.py
+0 −14 astropy_helpers/commands/install_lib.py
+0 −53 astropy_helpers/commands/register.py
+2 −5 astropy_helpers/commands/test.py
+0 −12 astropy_helpers/compat/__init__.py
+57 −0 astropy_helpers/conftest.py
+1 −1 astropy_helpers/distutils_helpers.py
+0 −11 astropy_helpers/extern/__init__.py
+0 −1 astropy_helpers/extern/automodapi/__init__.py
+0 −131 astropy_helpers/extern/automodapi/autodoc_enhancements.py
+0 −397 astropy_helpers/extern/automodapi/automodapi.py
+0 −624 astropy_helpers/extern/automodapi/automodsumm.py
+0 −92 astropy_helpers/extern/automodapi/smart_resolver.py
+0 −10 astropy_helpers/extern/automodapi/templates/autosummary_core/base.rst
+0 −65 astropy_helpers/extern/automodapi/templates/autosummary_core/class.rst
+0 −41 astropy_helpers/extern/automodapi/templates/autosummary_core/module.rst
+0 −213 astropy_helpers/extern/automodapi/utils.py
+0 −3 astropy_helpers/extern/numpydoc/__init__.py
+0 −585 astropy_helpers/extern/numpydoc/docscrape.py
+0 −284 astropy_helpers/extern/numpydoc/docscrape_sphinx.py
+0 −83 astropy_helpers/extern/numpydoc/linkcode.py
+0 −206 astropy_helpers/extern/numpydoc/numpydoc.py
+0 −4 astropy_helpers/extern/setup_package.py
+9 −4 astropy_helpers/git_helpers.py
+107 −0 astropy_helpers/openmp_helpers.py
+45 −66 astropy_helpers/setup_helpers.py
+0 −8 astropy_helpers/sphinx/__init__.py
+2 −350 astropy_helpers/sphinx/conf.py
+0 −2 astropy_helpers/sphinx/ext/__init__.py
+0 −78 astropy_helpers/sphinx/ext/changelog_links.py
+0 −38 astropy_helpers/sphinx/ext/doctest.py
+0 −165 astropy_helpers/sphinx/ext/edit_on_github.py
+0 −0 astropy_helpers/sphinx/ext/tests/__init__.py
+0 −18 astropy_helpers/sphinx/ext/tocdepthfix.py
+ astropy_helpers/sphinx/local/python2_local_links.inv
+0 −25 astropy_helpers/sphinx/local/python2_local_links.txt
+ astropy_helpers/sphinx/local/python3_local_links.inv
+0 −38 astropy_helpers/sphinx/local/python3_local_links.txt
+0 −10 astropy_helpers/sphinx/setup_package.py
+0 −3 astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html
+0 −96 astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html
+0 −3 astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html
+0 −7 astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html
+0 −75 astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout.svg
+ astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png
+ astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico
+0 −87 astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.svg
+ astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png
+0 −601 astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css
+0 −63 astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
+0 −160 astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
+0 −10 astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf
+0 −13 astropy_helpers/test_helpers.py
+41 −32 astropy_helpers/tests/__init__.py
+1 −0 astropy_helpers/tests/coveragerc
+114 −87 astropy_helpers/tests/test_ah_bootstrap.py
+30 −17 astropy_helpers/tests/test_git_helpers.py
+38 −0 astropy_helpers/tests/test_openmp_helpers.py
+118 −49 astropy_helpers/tests/test_setup_helpers.py
+18 −79 astropy_helpers/utils.py
+16 −13 astropy_helpers/version_helpers.py
+0 −436 ez_setup.py
+28 −0 licenses/LICENSE_ASTROSCRAPPY.rst
+0 −50 licenses/LICENSE_COPYBUTTON.rst
+0 −94 licenses/LICENSE_NUMPYDOC.rst
+6 −3 setup.py
+0 −19 tox.ini
Loading