Skip to content

Commit

Permalink
Merge pull request #66 from ocefpaf/modernize_cis
Browse files Browse the repository at this point in the history
Modernize CIs
  • Loading branch information
ocefpaf authored Apr 15, 2019
2 parents 82fd9b7 + 7f89e70 commit 5322b0b
Show file tree
Hide file tree
Showing 19 changed files with 126 additions and 35 deletions.
25 changes: 25 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
build: false

environment:
matrix:
- PYTHON: "C:\\Miniconda36-x64"
PY: 3.7

install:
# Install and configure miniconda.
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
- conda update conda --quiet
- conda install pycryptosat --quiet
- conda config --add channels conda-forge --force
- conda config --set sat_solver pycryptosat
- conda config --set channel_priority strict
- conda config --set safety_checks disabled

# Create the test env.
- conda create --name TEST python=%PY% --file requirements.txt --file requirements-dev.txt
- activate TEST

test_script:
- pip install -e . --no-deps --force-reinstall
- pytest -n 2 -rxs tests
91 changes: 67 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,81 @@ language: python

sudo: false

env:
global:
- secure: "ZN/NaiMNwlLUbxD4P+ha8SDfv1hfaJl9Dm838Z27cGPrOOFYC66sC1zLYnlWn1qeutyKZcML+EJ8m+aARe7ONQ97Noshm0i2ldtTAthpIoCOmIWja+9TvWQ5L3if3FUt9OsiHunkOZUM0IUILYryEgCrisUtO2WzcPs2XMO+c8M="

matrix:
fast_finish: true
include:
- python: 2.7
env: TEST_TARGET=default
- python: 3.5
env: TEST_TARGET=default
- python: 3.6
env: TEST_TARGET=default
- python: 3.6
env: TEST_TARGET=coding_standards
- name: "python-3.7"
env: PY=3.7
- name: "python-3.6"
env: PY=3.6
- name: "python-2.7"
env: PY=2.7
- name: "coding_standards"
env: PY=3.7
- name: "docs"
env: PY=3.7
allow_failures:
- name: "coding_standards"
env: PY=3.7

before_install:
- wget http://bit.ly/miniconda -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
- conda update conda
- conda config --add channels conda-forge --force
- conda create --name TEST python=$TRAVIS_PYTHON_VERSION --file requirements.txt --file requirements-dev.txt
- source activate TEST
# Install miniconda and create TEST env.
- |
wget http://bit.ly/miniconda -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
conda update conda --quiet
conda install pycryptosat --quiet
conda config --add channels conda-forge --force
conda config --set sat_solver pycryptosat
conda config --set channel_priority strict
conda config --set safety_checks disabled
conda create --name TEST python=$PY --file requirements.txt --file requirements-dev.txt
source activate TEST
install:
# Test source distribution.
- python setup.py sdist && version=$(python setup.py --version) && pushd dist && pip install UTide-${version}.tar.gz && popd
- python setup.py sdist && version=$(python setup.py --version) && pushd dist && pip install --no-deps --force-reinstall UTide-${version}.tar.gz && popd

script:
- if [[ $TEST_TARGET == 'default' ]]; then
py.test -vv ;
fi
- if [[ $TRAVIS_JOB_NAME == python-* ]]; then
cp -r tests/ /tmp ;
pushd /tmp && pytest -n 2 -rxs --cov=utide tests && popd ;
fi

- if [[ $TEST_TARGET == 'coding_standards' ]]; then
pycodestyle --ignore=E741,E226,W504 --max-line-length=100 tests ;
pycodestyle --ignore=E741,E226,W504 --max-line-length=100 utide ;
- if [[ $TRAVIS_JOB_NAME == 'coding_standards' ]]; then
pytest --flake8 -m flake8 ;
fi

- |
if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then
set -e
conda install doctr
pushd docs
make clean html linkcheck
popd
if [[ -z "$TRAVIS_TAG" ]]; then
python -m doctr deploy --build-tags --key-path github_deploy_key_wesleybowman_utide.enc --built-docs docs/_build/html dev
else
python -m doctr deploy --build-tags --key-path github_deploy_key_wesleybowman_utide.enc --built-docs docs/_build/html "version-$TRAVIS_TAG"
python -m doctr deploy --build-tags --key-path github_deploy_key_wesleybowman_utide.enc --built-docs docs/_build/html .
fi
fi
deploy:
skip_cleanup: true
provider: pypi
user: ocefpaf
password:
secure: "n7V/06zaWzAHiAx2YLh6n+glbRKHEdHntw8oOJXQJKQaiDzJR+Be2FANZ4rSof4kkDVUwwqTNzAuVn43BJBt4WdKdh3PWZwhfm4+/lzN1lpwyhK+P/5IUxSynov2JcqzvJtmrGCELEqrULBvrbBbcf9f93NPUr6Id5iA0shKv4w="
distributions: sdist bdist_wheel
upload_docs: no
on:
repo: wesleybowman/UTide
tags: true
all_branches: master
condition: '$TRAVIS_JOB_NAME == "python-3.7"'
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
UTide
=====
|travis| |license| |conda| |downloads| |anaconda_cloud|
|travis| |license| |conda| |downloads| |anaconda_cloud| |appveyor|

.. |travis| image:: https://travis-ci.org/wesleybowman/UTide.svg?branch=master
:target: https://travis-ci.org/wesleybowman/UTide
Expand All @@ -17,6 +17,10 @@ UTide
.. |anaconda_cloud| image:: https://anaconda.org/conda-forge/utide/badges/version.svg
:target: https://anaconda.org/conda-forge/utide

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/4o163ma4ehhr3q48/branch/master?svg=true
:target: https://ci.appveyor.com/project/wesleybowman/utide/branch/master


Python re-implementation of the Matlab package UTide.

Still in heavy development--everything is subject to change!
Expand Down
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.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions github_deploy_key_wesleybowman_utide.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gAAAAABctHINHbJo74bSpj4MSjKOYz5AwU0qWjTJmoQ2Yw73TSVvFql3h7ERrxxmo3Sbw96YlBR00KXDSPeKnCen0QX8vdBE-fR_tEqgCElBklDTD4L1AYW6CM8Nl7ZyING8DQ0HMsSjSyGLzsmUQU96w5r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es: 9 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
flake8
flake8-builtins
flake8-comprehensions
flake8-mutable
flake8-print
matplotlib
pandas
pycodestyle
pytest
pytest-cov
pytest-flake8
pytest-xdist
sphinx
twine
12 changes: 12 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ versionfile_source = utide/_version.py
versionfile_build = utide/_version.py
tag_prefix = v
parentdir_prefix =

[tool:pytest]
flake8-max-line-length = 105
flake8-ignore =
E741,E226,W504
docs/* ALL
versioneer.py ALL
utide/_version.py ALL

[metadata]
description-file = README.rst
license_file = LICENSE.txt
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ def read(*parts):
return open(os.path.join(rootpath, *parts), 'r').read()


long_description = '{}\n{}'.format(read('README.rst'), read('LICENSE.txt'))

with open('requirements.txt') as f:
require = f.readlines()
install_requires = [r.strip() for r in require]

setup(name='UTide',
version=versioneer.get_version(),
license='MIT',
long_description=long_description,
long_description=read('README.rst'),
classifiers=['Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
Expand Down
11 changes: 5 additions & 6 deletions tests/test_uv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
from utide.utilities import Bunch


@pytest.fixture
def fake_tide(t, M2amp, M2phase):
def _fake_tide(t, M2amp, M2phase):
"""
Generate a minimally realistic-looking fake semidiurnal tide.
Expand All @@ -36,14 +35,14 @@ def make_data():
np.random.seed(1234)
t = date_range(start='2016-03-29', periods=N, freq='H')
# Signal + some noise.
u = fake_tide(np.arange(N), M2amp=2, M2phase=0) + np.random.randn(N)
v = fake_tide(np.arange(N), M2amp=1, M2phase=np.pi) + np.random.randn(N)
u = _fake_tide(np.arange(N), M2amp=2, M2phase=0) + np.random.randn(N)
v = _fake_tide(np.arange(N), M2amp=1, M2phase=np.pi) + np.random.randn(N)
time = date2num(t.to_pydatetime())
return time, u, v


def test_solve():
time, u, v = make_data()
def test_solve(make_data):
time, u, v = make_data
coef = solve(time, u, v,
lat=-42.5,
nodal=False,
Expand Down
2 changes: 1 addition & 1 deletion utide/periodogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def band_psd(t, e, cfrq, equi=True, frqosamp=1):
t = t[:-1]
nt -= 1

hn = signal.hanning(nt, sym=False)
hn = signal.windows.hann(nt, sym=False)

# on real component
if equi: # If even sampling, FFT.
Expand Down

0 comments on commit 5322b0b

Please sign in to comment.