Skip to content

Commit

Permalink
Merge a06524d into 7d60624
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarbary committed Jun 1, 2019
2 parents 7d60624 + a06524d commit 72161e9
Show file tree
Hide file tree
Showing 47 changed files with 209 additions and 1,058 deletions.
79 changes: 30 additions & 49 deletions .continuous-integration/travis/setup_dependencies_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,39 @@ conda config --set always_yes yes --set changeps1 no
conda update -q --yes conda
conda info -a

# CONDA
conda create --yes -n test python=$PYTHON_VERSION pip
source activate test

# --no-use-wheel requirement is temporary due to
# https://github.com/astropy/astropy/issues/4180
# and may be removed once the upstream fix is in place
export PIP_INSTALL="pip install --no-deps"

# Now set up shortcut to conda install command to make sure the Python and Numpy
# versions are always explicitly specified.
export CONDA_INSTALL="conda install --yes python=$PYTHON_VERSION numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION"

# EGG_INFO
if [[ $SETUP_CMD == egg_info ]]
then
return # no more dependencies needed
fi

# PEP8
if [[ $MAIN_CMD == *checkstyle* ]]
if [[ $MAIN_CMD == *egg_info* ]]
then
conda install --yes python=$PYTHON_VERSION pycodestyle
return # no more dependencies needed
fi

# CORE DEPENDENCIES (besides astropy)
$CONDA_INSTALL jinja2 psutil cython extinction

# ASTROPY
if [[ $ASTROPY_VERSION == dev ]]
export CONDA_PACKAGES="python=$PYTHON_VERSION pip"
# STYLE
elif [[ $MAIN_CMD == *checkstyle* ]]
then
$PIP_INSTALL git+http://github.com/astropy/astropy.git
export CONDA_PACKAGES="python=$PYTHON_VERSION pip pycodestyle"
# EVERYTHING ELSE:
else
$CONDA_INSTALL astropy=$ASTROPY_VERSION
# core dependencies
export CONDA_PACKAGES="python=$PYTHON_VERSION pip pytest numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION astropy=$ASTROPY_VERSION cython extinction"

# optional dependencies
if $OPTIONAL_DEPS
then
export CONDA_PACKAGES="$CONDA_PACKAGES matplotlib iminuit"
export PIP_INSTALL="pip install --no-deps nestle"
fi

# doc dependencies
if [[ $MAIN_CMD == *docs* ]]
then
export CONDA_PACKAGES="$CONDA_PACKAGES sphinx sphinx-gallery pygments matplotlib pillow sphinx_rtd_theme numpydoc"
fi

# coverage dependencies
if [[ $MAIN_CMD == *"--cov"* ]]
then
export CONDA_PACKAGES="$CONDA_PACKAGES coverage coveralls pytest-cov"
fi
fi

# OPTIONAL DEPENDENCIES
if $OPTIONAL_DEPS
then
$CONDA_INSTALL matplotlib iminuit
$PIP_INSTALL nestle
fi

# DOCUMENTATION DEPENDENCIES
if [[ $SETUP_CMD == *docs* ]]
then
$CONDA_INSTALL sphinx sphinx-gallery pygments matplotlib pillow sphinx_rtd_theme numpydoc
fi

# COVERAGE DEPENDENCIES
if [[ $SETUP_CMD == *"--coverage"* ]]
then
$CONDA_INSTALL coverage coveralls
fi
conda create --yes -n test $CONDA_PACKAGES
source activate test
$PIP_INSTALL
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ docs/modules

# Other generated files
MANIFEST
sncosmo/version.py
sncosmo/cython_version.py

# emacs files
# editors
*~
.vscode

# pycharm files
.idea
Expand All @@ -59,5 +58,6 @@ misc/*.o
misc/*.d
misc/test-salt2model

# from testing?
.cache
# testing
.cache
.pytest_cache
44 changes: 19 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ addons:
env:
global:
# Set defaults to avoid repeating in most cases.
- NUMPY_VERSION=1.12
- ASTROPY_VERSION=1.3
- SCIPY_VERSION=0.19
- NUMPY_VERSION=1.15
- ASTROPY_VERSION=3.0
- SCIPY_VERSION=1.1
- OPTIONAL_DEPS=true
- MAIN_CMD='python setup.py'
- SETUP_CMD='build_ext --inplace'
- MAIN_CMD='pytest sncosmo --no-downloads'
- MPLBACKEND="agg"

matrix:
- PYTHON_VERSION=2.7 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.5 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.6 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.5 SETUP_CMD='egg_info' MAIN_CMD=''
- PYTHON_VERSION=3.6 SETUP_CMD='egg_info' MAIN_CMD=''
- PYTHON_VERSION=3.7 SETUP_CMD='egg_info' MAIN_CMD=''

matrix:

Expand All @@ -44,49 +45,42 @@ matrix:

include:

# Try Mac OS X
- os: osx
env: PYTHON_VERSION=2.7 SETUP_CMD='test'
- os: osx
env: PYTHON_VERSION=3.6 SETUP_CMD='test'
env: PYTHON_VERSION=3.6

# Try different python versions
- os: linux
env: PYTHON_VERSION=2.7 SETUP_CMD='test'
env: PYTHON_VERSION=3.5
- os: linux
env: PYTHON_VERSION=3.6 SETUP_CMD='test --remote-data any'
env: PYTHON_VERSION=3.7

# Try astropy 1.0 version and some older dependencies
- os: linux
env: PYTHON_VERSION=2.7 NUMPY_VERSION=1.10 SCIPY_VERSION=0.17 ASTROPY_VERSION=1.0 SETUP_CMD='test'
- os: linux
env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.10 SCIPY_VERSION=0.17 ASTROPY_VERSION=1.0 SETUP_CMD='test'
env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.10 SCIPY_VERSION=0.17 ASTROPY_VERSION=1.0

# Try disabling optional dependencies
- os: linux
env: PYTHON_VERSION=2.7 OPTIONAL_DEPS=false SETUP_CMD='test'
- os: linux
env: PYTHON_VERSION=3.6 OPTIONAL_DEPS=false SETUP_CMD='test'
env: PYTHON_VERSION=3.6 OPTIONAL_DEPS=false

# Do a pycodestyle test
- os: linux
env: PYTHON_VERSION=3.6 MAIN_CMD='./checkstyle' SETUP_CMD=''
env: PYTHON_VERSION=3.6 SETUP_CMD='egg_info' MAIN_CMD='./checkstyle'

# coverage test
- os: linux
env: PYTHON_VERSION=3.6 SETUP_CMD='test --coverage'
env: PYTHON_VERSION=3.6 MAIN_CMD='pytest sncosmo --cov=sncosmo --no-downloads'

# Try a doc build
- os: linux
env: PYTHON_VERSION=3.6 SETUP_CMD='install; cd docs && make html'
env: PYTHON_VERSION=3.6 SETUP_CMD='install' MAIN_CMD='cd docs && make html'

install:
- source .continuous-integration/travis/setup_environment_$TRAVIS_OS_NAME.sh

- python setup.py $SETUP_CMD
script:
- eval $MAIN_CMD $SETUP_CMD
- eval $MAIN_CMD

after_success:
- if [[ $SETUP_CMD == *"--coverage"* ]]; then
- if [[ $MAIN_CMD == *"--cov"* ]]; then
coveralls --rcfile='sncosmo/tests/coveragerc';
fi
11 changes: 4 additions & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
include README.md
include CITATION.md
include LICENSE.rst
include pyproject.toml

recursive-include sncosmo *.c *.pyx
recursive-include docs *
recursive-include sncosmo *.pyx
recursive-exclude sncosmo *.c

exclude __pycache__
exclude *.pyc *.o
prune docs/_build
prune docs/api
prune build
global-exclude __pycache__
11 changes: 5 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ environment:
global:
PYTHON: "C:\\conda"
MINICONDA_VERSION: "latest"
CONDA_DEPENDENCIES: "scipy cython"
CONDA_DEPENDENCIES: "scipy cython pytest"
PIP_DEPENDENCIES: "extinction"
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\.continuous-integration\\appveyor\\windows_sdk.cmd"
PYTHON_ARCH: "64" # needs to be set for CMD_IN_ENV to succeed. If a mix
# of 32 bit and 64 bit builds are needed, move this
# to the matrix section.

matrix:
- PYTHON_VERSION: "2.7"
NUMPY_VERSION: "stable"
ASTROPY_VERSION: "stable"

- PYTHON_VERSION: "3.5"
NUMPY_VERSION: "1.12"
ASTROPY_VERSION: "lts"
Expand All @@ -44,9 +40,12 @@ install:
- "conda --version"
- "python --version"

# install
- "python setup.py build_ext --inplace"

# Not a .NET project, we build ci-helpers in the install step instead
build: false

test_script:
- "%CMD_IN_ENV% python setup.py test"
- "%CMD_IN_ENV% pytest sncosmo"

2 changes: 0 additions & 2 deletions benchmarks/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
"""Run benchmarks for model synthetic photometry"""

from __future__ import print_function, division

import time
import os
import glob
Expand Down
2 changes: 0 additions & 2 deletions docs/_examples/plot_custom_fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
Here, we give a minimal example of using the L-BFGS-B minimizer from scipy.
"""

from __future__ import print_function

import numpy as np
from scipy.optimize import fmin_l_bfgs_b
import sncosmo
Expand Down
2 changes: 0 additions & 2 deletions docs/_examples/plot_custom_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
determines the relative weight of the models.
"""

from __future__ import print_function

import numpy as np
from scipy.interpolate import RectBivariateSpline
import sncosmo
Expand Down
2 changes: 0 additions & 2 deletions docs/_examples/plot_lc_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
First, we'll load an example of some photometric data.
"""

from __future__ import print_function

import sncosmo

data = sncosmo.load_example_data()
Expand Down
1 change: 0 additions & 1 deletion docs/_helpers/bandpass_plot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Helper function to plot a set of bandpasses in sphinx docs."""
from __future__ import division

import numpy as np
from matplotlib import rc
Expand Down
9 changes: 6 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

import sys
import os
import datetime

import sphinx_rtd_theme
import sphinx_gallery
import matplotlib.sphinxext.plot_directive
Expand Down Expand Up @@ -92,9 +94,10 @@
# -- Project information ------------------------------------------------------

# This does not *have* to match the package name, but typically does
project = u'sncosmo'
author = u'Kyle Barbary and contributors'
copyright = u'2013-2019, ' + author
project = 'sncosmo'
author = 'Kyle Barbary and contributors'
current_year = datetime.datetime.now().year
copyright = '2013-{:d}, {}'.format(current_year, author)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
28 changes: 10 additions & 18 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,36 +170,28 @@ Yes, this could be more automated, but it isn't done very often,
and involves some human verification.

- Update ``docs/history.rst`` with a summary of the new version's changes.
- Bump version in ``setup.py``.
- Check copyright year in ``docs/conf.py``.
- Bump version in ``sncosmo/__init__.py``.
- Build package and docs and check that docs look good.
- Commit.
- ``git clean -dfx``
- ``setup.py sdist``
- Check that the tarball in ``dist/`` can be unpacked and
that ``setup.py test`` succeeds. Bonus: create a fresh conda
environment (or virtual environment) with minimal requirements and
install and test in that.
- ``setup.py register``
- ``setup.py sdist upload``
- ``tox`` (test in clean virtual env and make sure everything passes.
- ``setup.py sdist upload`` (register new version and upload.)

**Post-release steps:**

- If not a bugfix release, create a feature branch. For example,
``git branch v1.1.x``.
- Tag the release. For example, ``git tag v1.1.0``.
- On master, bump version in ``setup.py`` to the next development
version and add the next development version to
``docs/whatsnew.rst``.
- On master, bump version in ``sncosmo/__init__.py`` to the next development
version.
- Commit.
- Push repo changes to GitHub. For example:
``git push upstream master v1.1.x v1.1.0``.

**Docs and conda**

- On readthedocs.org, set the new feature branch to "active".
- To trigger new conda build, edit version number in requirements.txt
in https://github.com/astropy/conda-builder-affiliated and submit
a pull request.
- Once conda build succeeds, make the new feature branch the default
on readthedocs.org.
- A conda build should start (with some delay) via a bot pull request
at https://github.com/conda-forge/sncosmo-feedstock. Merge the PR
once it passes all tests.
- On readthedocs.org, set the new feature branch to "active"
and make it the default.
11 changes: 11 additions & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ sncosmo v1.0 will continue to work with any v1.x version. However,
exact results may differ between versions in the 1.x series. (For
example, due to changes in integration method.)

v2.0.0 (?)
==========

This version is the same as v1.8.0, with the exception that Python 2 support
has been removed, and deprecated functions and attributes have been removed.
These were deprecated in v1.5.0 (released April 2017) or before.

On Python 2, pip should automatically install sncosmo v1.8.0 still. If not,
specify ``sncosmo<2.0.0``.


v1.8.0 (2019-05-25)
===================

Expand Down

0 comments on commit 72161e9

Please sign in to comment.