Skip to content

Commit

Permalink
Merge pull request #123 from dopplershift/infra-updates
Browse files Browse the repository at this point in the history
Modernize infrastructure
  • Loading branch information
lesserwhirls authored Mar 21, 2017
2 parents 628f772 + f45e757 commit 702be20
Show file tree
Hide file tree
Showing 68 changed files with 1,127 additions and 2,969 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ lib64
__pycache__
.ipynb_checkpoints/
docs/build
docs/source/examples/generated/
examples/scripts/
docs/examples
docs/api/generated

# Installer logs
pip-log.txt
Expand Down
109 changes: 43 additions & 66 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ addons:
paths:
- $(find $WHEELDIR -newer $WHEELDIR/download_marker -name *.whl | tr [:space:] :)
apt:
packages: &base_build
packages:
- libhdf5-serial-dev
- libnetcdf-dev

Expand All @@ -30,19 +30,10 @@ env:
- EXTRAS="test"
matrix:
- TASK="coverage"
- TASK="lint"
- TASK="docs"

matrix:
include:
- python: 3.6
env: TASK="examples"
- python: 2.7
env: TASK="docs"
addons:
apt:
packages:
- *base_build
- pandoc
- python: 3.4
env:
- python: 3.5
Expand All @@ -56,78 +47,64 @@ matrix:
- python: nightly

before_install:
# Shapely dependency needed to keep from using Shapely's manylinux wheels
# which use a different geos that what we build cartopy with on Travis
- pip install --upgrade pip;
- if [[ $TASK == "lint" ]]; then
pip install flake8 pep8-naming;
elif [[ $TASK == "docs" ]]; then
pip install -r docs/requirements.txt -f $WHEELHOUSE;
- if [[ $TASK == "docs" ]]; then
if ! git describe --tags; then git fetch --depth=150; fi;
export EXTRAS="doc,examples,netcdf";
export EXTRA_PACKAGES="Cython pillow sphinx_rtd_theme shapely<1.5.17.post1";
ls $HOME/local/lib/;
if [[ ! -f $HOME/local/lib/libproj.so ]]; then
wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz;
tar xf proj-4.9.3.tar.gz;
pushd proj-4.9.3;
./configure --prefix=$HOME/local;
make;
sed -i "" -e s/-I// proj.pc;
make install;
popd;
fi;
export PKG_CONFIG_PATH="$HOME/local/lib/pkgconfig";
export LD_LIBRARY_PATH="$HOME/local/lib";
pkg-config --modversion proj;
else
export EXTRA_PACKAGES="Cython";
if [[ $TASK == "examples" ]]; then
export EXTRAS="$EXTRAS,examples";
export EXTRA_PACKAGES="$EXTRA_PACKAGES nbconvert[execute] ipykernel";
ls $HOME/local/lib/;
if [[ ! -f $HOME/local/lib/libproj.so ]]; then
wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz;
tar xf proj-4.9.3.tar.gz;
pushd proj-4.9.3;
./configure --prefix=$HOME/local;
make;
sed -i "" -e s/-I// proj.pc;
make install;
popd;
fi;
export PKG_CONFIG_PATH="$HOME/local/lib/pkgconfig";
export LD_LIBRARY_PATH="$HOME/local/lib";
pkg-config --modversion proj;
elif [[ $TASK == "coverage" ]]; then
export TEST_OPTS="--flake8";
if [[ $TASK == "coverage" ]]; then
export TEST_OPTS="$TEST_OPTS --cov=siphon";
pip install pytest-cov;
fi;
mkdir $WHEELDIR;
pip download -d $WHEELDIR ".[$EXTRAS]" $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
touch $WHEELDIR/download_marker && ls -lrt $WHEELDIR;
travis_wait pip wheel -w $WHEELDIR $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
pip install $EXTRA_PACKAGES --upgrade --no-index -f file://$PWD/$WHEELDIR $VERSIONS;
travis_wait pip wheel ".[$EXTRAS]" -w $WHEELDIR -f $WHEELHOUSE $PRE $VERSIONS;
rm -f $WHEELDIR/siphon*.whl;
fi
fi;
- mkdir $WHEELDIR;
- pip download -d $WHEELDIR ".[$EXTRAS]" $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
- touch $WHEELDIR/download_marker && ls -lrt $WHEELDIR;
- travis_wait pip wheel -w $WHEELDIR $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
- pip install $EXTRA_PACKAGES --upgrade --no-index -f file://$PWD/$WHEELDIR $VERSIONS;
- travis_wait pip wheel -w $WHEELDIR ".[$EXTRAS]" $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
- rm -f $WHEELDIR/siphon*.whl;

install:
- if [[ $TASK != "lint" && $TASK != "docs" ]]; then
pip install ".[$EXTRAS]" --upgrade --no-index -f file://$PWD/$WHEELDIR $VERSIONS;
if [[ $TASK == "examples" ]]; then
python setup.py examples;
fi;
fi
- pip install ".[$EXTRAS]" --upgrade --no-index $PRE -f file://$PWD/$WHEELDIR $VERSIONS;

script:
- if [[ $TASK == "lint" ]]; then
flake8 siphon;
elif [[ $TASK == "docs" ]]; then
- if [[ $TASK == "docs" ]]; then
pushd docs;
make html 2>../docs.log;
make clean html linkcheck;
export DOC_BUILD_RESULT=$?;
popd;
doc8 README.rst docs/source;
if [ -s docs.log -o $? -ne 0 ]; then
echo Doc build produced warnings or errors:;
cat docs.log;
doc8 README.rst docs;
if [[ $DOC_BUILD_RESULT -ne 0 || $? -ne 0 ]]; then
false;
fi;
elif [[ $TASK == "examples" ]]; then
if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then
sed -i -e "s/python3/python2/" examples/notebooks/*.ipynb;
fi;
find examples/notebooks/ -name \*.ipynb -print0 | xargs -0 -n1 jupyter nbconvert --execute --ExecutePreprocessor.timeout=300 --to=notebook --stdout >| /dev/null;
elif [[ $TASK == "coverage" ]]; then
python setup.py test --addopts --cov=siphon;
else
python setup.py test;
flake8 --version;
python setup.py test --addopts "-s $TEST_OPTS";
fi

after_success:
after_script:
- if [[ $TASK == "coverage" ]]; then
pip install codecov codacy-coverage;
codecov;
codecov -e TRAVIS_PYTHON_VERSION;
coverage xml;
python-codacy-coverage -r coverage.xml;
fi
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2016 University Corporation for Atmospheric Research/Unidata
Copyright (c) 2013-2016 University Corporation for Atmospheric Research/Unidata.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 13 additions & 13 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ environment:

matrix:
- PYTHON_VERSION: "2.7"
#- PYTHON_VERSION: "3.4"
- PYTHON_VERSION: "3.5"
- PYTHON_VERSION: "3.6"

platform:
- x86
- x64

install:
# Use the pre-installed Miniconda for the desired arch
- ps: if($env:PYTHON_VERSION -eq '3.5')
{ $env:CONDA_PATH="$($env:CONDA_PATH)35" }
- ps: if($env:PYTHON_VERSION -eq '3.6')
{ $env:CONDA_PATH="$($env:CONDA_PATH)36" }
- ps: if($env:TARGET_ARCH -eq 'x64')
{ $env:CONDA_PATH="$($env:CONDA_PATH)-x64" }
- ps: $env:path="$($env:CONDA_PATH);$($env:CONDA_PATH)\Scripts;$($env:CONDA_PATH)\Library\bin;C:\cygwin\bin;$($env:PATH)"
Expand All @@ -30,18 +29,19 @@ install:
- cmd: python --version
- cmd: conda list
- cmd: if %PYTHON_VERSION% == 2.7 conda install enum34
- cmd: pip install ".[test]"
- cmd: python -m ipykernel install --user --name devel --display-name "devel"
- cmd: pip install ".[test,doc,examples]"

# Skip .NET project specific build phase.
build: off

test_script:
- cmd: python setup.py test --addopts --cov=siphon
- cmd: cd examples/notebooks
- cmd: find . -name "*.ipynb" -print0 | xargs -0 -n1 jupyter nbconvert --execute --ExecutePreprocessor.timeout=180 --ExecutePreprocessor.kernel_name=devel --inplace
- cmd: cd ../..

after_test:
- cmd: python setup.py test --addopts "-s --junitxml=tests.xml --flake8 --cov=siphon"
- cmd: cd docs
- cmd: make html
- cmd: cd ..

on_finish:
- ps: $wc = New-Object 'System.Net.WebClient'
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\tests.xml))
- cmd: pip install codecov
- cmd: codecov
- cmd: codecov -e PYTHON_VERSION PLATFORM
11 changes: 6 additions & 5 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -W
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
NBCONVERT = ipython nbconvert
HTMLBUILDDIR = $(BUILDDIR)/html
SOURCEDIR = .

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
Expand All @@ -16,9 +17,9 @@ endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

Expand Down Expand Up @@ -48,7 +49,7 @@ help:
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
rm -rf $(BUILDDIR)/*
rm -rf $(BUILDDIR)/* $(SOURCEDIR)/examples $(SOURCEDIR)/api/generated

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down
File renamed without changes
7 changes: 7 additions & 0 deletions docs/_static/theme_override.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
div[class^="highlight"] a {
background-color: #E6E6E6;
}

div[class^="highlight"] a:hover {
background-color: #ABECFC;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 17 additions & 1 deletion docs/source/conf.py → docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'notebook_gen_sphinxext'
'sphinx_gallery.gen_gallery'
]

mathjax_path = 'https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
Expand All @@ -50,6 +50,19 @@
'requests': ('http://docs.python-requests.org/en/master/', None),
}

sphinx_gallery_conf = {
'doc_module': ('siphon',),
'reference_url': {
'siphon': None,
'matplotlib': 'http://matplotlib.org',
'numpy': 'http://docs.scipy.org/doc/numpy/',
'requests': 'http://docs.python-requests.org/en/master/'},
'examples_dirs': ['../examples'],
'gallery_dirs': ['examples'],
'filename_pattern': '/',
'mod_example_dir': 'api/generated'
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -128,6 +141,9 @@
except ImportError:
pass

def setup(app):
app.add_stylesheet('theme_override.css')

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
Expand Down
9 changes: 2 additions & 7 deletions docs/source/developerguide.rst → docs/developerguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,9 @@ Documentation
Siphon's documentation is built using sphinx >= 1.4. API documentation is automatically
generated from docstrings, written using the
`NumPy docstring standard <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_.
There are also example IPython notebooks in the ``examples/notebooks`` directory. Using
IPython's API, these are automatically converted to restructured text for inclusion in the
documentation. The examples can also be converted to standalone scripts using:
There are also examples in the ``examples/`` directory.

.. parsed-literal::
python setup.py examples
The documentation is hosted on `GitHub Pages <https://unidata.github.io/MetPy>`_. The docs are
The documentation is hosted on `GitHub Pages <https://unidata.github.io/siphon>`_. The docs are
built automatically from ``master`` with every build on Travis-CI; every merged PR will
have the built docs upload to GitHub Pages. As part of the build, the documentation is also
checked with ``doc8``. To see what the docs will look like, you also need to install the
Expand Down
File renamed without changes.
7 changes: 1 addition & 6 deletions docs/source/installguide.rst → docs/installguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ This will build and install Siphon into your current Python installation.
Examples
--------

The Siphon source comes with a set of example IPython notebooks in the ``examples/notebooks``
directory. These can also be converted to standalone scripts (provided IPython is installed)
using:

.. parsed-literal::
python setup.py examples
The Siphon source comes with a set of examples in the ``examples/`` directory.

These examples are also seen within the documentation in the :ref:`examples-index`.
4 changes: 2 additions & 2 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
set I18NSPHINXOPTS=%SPHINXOPTS% source
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
Expand Down
2 changes: 0 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
sphinx>=1.3
nbconvert[execute]>=4.1
sphinx_rtd_theme
ipython
doc8
10 changes: 0 additions & 10 deletions docs/source/examples/index.rst

This file was deleted.

Loading

0 comments on commit 702be20

Please sign in to comment.