Skip to content

Commit

Permalink
Update packaging etc (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceball authored and philippjfr committed Aug 31, 2018
1 parent 3b863eb commit 5233c48
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 76 deletions.
34 changes: 4 additions & 30 deletions .travis.yml
Expand Up @@ -20,16 +20,11 @@ env:
stages:
- test
- name: conda_dev_package
if: tag =~ ^v(\d+|\.)*[a-z]\d*$
- name: pip_dev_package
if: tag =~ ^v(\d+|\.)*[a-z]\d*$
if: tag =~ ^v(\d+|\.)+[a-z]\d+$
- name: conda_package
if: tag =~ ^v(\d+|\.)*[^a-z]\d*$
- name: pip_package
if: tag =~ ^v(\d+|\.)*[^a-z]\d*$
if: tag =~ ^v(\d+|\.)+[^a-z]\d+$
- name: docs
##if: tag =~ ^v(\d+|\.).*$

if: (branch = master) AND (type != pull_request)

jobs:
include:
Expand All @@ -49,10 +44,7 @@ jobs:
install:
- doit env_create $CHANS_DEV --python=$PYENV_VERSION
- source activate test-environment
# TODO: Use released param version
- pip install https://github.com/ioam/param/archive/param_mthd_deps_simplified.zip
- doit develop_install -o recommended -o tests $CHANS_DEV
- pip install https://github.com/ioam/param/archive/param_mthd_deps_simplified.zip
- doit env_capture
script: doit test_all_recommended

Expand All @@ -66,31 +58,16 @@ jobs:

## dev packages

- &pip_default
env: TRAVIS_NOCACHE=$TRAVIS_JOB_ID PYPI=testpypi PYPIUSER=$TPPU PYPIPASS=$TPPP
stage: pip_dev_package
before_install: pip install pyctdev && doit ecosystem=pip ecosystem_setup
install:
- unset PYENV_VERSION && pyenv global 3.6 2.7
- doit ecosystem=pip package_build $PKG_TEST_PYTHON --test-group=unit --sdist-install-build-deps
- doit ecosystem=pip package_build $PKG_TEST_PYTHON --test-group=examples --sdist-install-build-deps
script: doit ecosystem=pip package_upload -u $PYPIUSER -p $PYPIPASS --pypi ${PYPI}

- &conda_pkg
<<: *conda_default
stage: conda_dev_package
env: DESC="" TRAVIS_NOCACHE=$TRAVIS_JOB_ID LABELS=$LABELS_DEV CHANS=$CHANS_DEV
install:
- doit package_build $CHANS $PKG_TEST_PYTHON --test-group=unit
- doit package_test $CHANS $PKG_TEST_PYTHON --test-group=examples --test-requires=examples
script: doit package_upload --token=$ANACONDA_TOKEN $LABELS

## release packages

- <<: *pip_default
env: TRAVIS_NOCACHE=$TRAVIS_JOB_ID PYPI=pypi PYPIUSER=$PPU PYPIPASS=$PPP
stage: pip_package

- <<: *conda_pkg
stage: conda_package
env: DESC="" TRAVIS_NOCACHE=$TRAVIS_JOB_ID LABELS=$LABELS_REL CHANS=$CHANS_REL
Expand Down Expand Up @@ -118,9 +95,6 @@ jobs:
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: ./doc/_build/html
## fqdn: panel.pyviz.org
fqdn: panel.pyviz.org
on:
branch: master
## tags: true
## all_branches: true
## condition: $TRAVIS_TAG =~ [0-9]+[^a-z][0-9]*$
4 changes: 2 additions & 2 deletions LICENSE.txt
@@ -1,4 +1,4 @@
Copyright (c) 2005-2018, IOAM (ioam.github.com)
Copyright (c) 2018, PyViz contributors (pyviz.org)
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -13,7 +13,7 @@ met:
documentation and/or other materials provided with the
distribution.

* Neither the name of IOAM nor the names of its contributors
* Neither the name of PyViz nor the names of its contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.

Expand Down
5 changes: 0 additions & 5 deletions conda.recipe/meta.yaml
Expand Up @@ -9,13 +9,8 @@ source:

build:
noarch: python
number: 1
script: python setup.py --quiet install --single-version-externally-managed --record record.txt

extra:
channels:
- pyviz

requirements:
build:
- python {{ sdata['python_requires'] }}
Expand Down
1 change: 1 addition & 0 deletions panel/layout.py
Expand Up @@ -2,6 +2,7 @@
Defines Layout classes which may be used to arrange panels and widgets
in flexible ways to build complex dashboards.
"""
from __future__ import absolute_import

import param

Expand Down
2 changes: 2 additions & 0 deletions panel/panels.py
Expand Up @@ -2,6 +2,8 @@
Panels allow wrapping external objects and rendering them as part of
a dashboard.
"""
from __future__ import absolute_import

import inspect
import base64
from io import BytesIO
Expand Down
Empty file added panel/tests/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions panel/tests/test_dummy.py
@@ -0,0 +1,2 @@
def test_dummy():
print("no unit tests so far...")
2 changes: 2 additions & 0 deletions panel/util.py
@@ -1,3 +1,5 @@
from __future__ import absolute_import

import os
import json
import sys
Expand Down
2 changes: 2 additions & 0 deletions panel/viewable.py
Expand Up @@ -4,6 +4,8 @@
response to changes to parameters and the underlying bokeh models.
"""

from __future__ import absolute_import

from functools import partial
from collections import defaultdict

Expand Down
1 change: 1 addition & 0 deletions panel/widgets.py
Expand Up @@ -2,6 +2,7 @@
Provides a set of reactive widgets which provide bi-directional
communication between the rendered dashboard and the Widget parameters.
"""
from __future__ import absolute_import

import ast

Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
@@ -0,0 +1,6 @@
[build-system]
requires = [
"param >=1.7.0",
"pyct >=0.4.4",
"setuptools >=30.3.0"
]
9 changes: 4 additions & 5 deletions setup.py
Expand Up @@ -27,12 +27,11 @@ def get_setup_version(reponame):

install_requires = [
'bokeh >=0.12.15',
'param >=1.6.1',
'param >=1.8.0a0',
'pyviz_comms'
]

_recommended = [
'param >=1.6.1',
'notebook >=5.4'
]

Expand All @@ -46,7 +45,6 @@ def get_setup_version(reponame):
'nbsmoke >=0.2.0'
],
'recommended': _recommended,
'examples_extra': _recommended,
'doc': _recommended + [
'nbsite',
'sphinx_ioam_theme'
Expand All @@ -58,8 +56,9 @@ def get_setup_version(reponame):
# until pyproject.toml/equivalent is widely supported (setup_requires
# doesn't work well with pip)
extras_require['build'] = [
'param >=1.6.1',
'setuptools' # should make this pip now
'param >=1.7.0',
'pyct >=0.4.4',
'setuptools >=30.3.0'
]

setup_args = dict(
Expand Down
41 changes: 7 additions & 34 deletions tox.ini
Expand Up @@ -3,7 +3,7 @@

[tox]
# python version test group extra envs extra commands
envlist = {py27,py35,py36}-{flakes,unit,examples,all_recommended,examples_extra}-{default}-{dev,pkg}
envlist = {py27,py35,py36}-{flakes,unit,examples,all_recommended}-{default}-{dev,pkg}

[_flakes]
description = Flake check python and notebooks
Expand All @@ -12,68 +12,41 @@ commands = flake8
# pytest --nbsmoke-lint -k ".ipynb"

[_unit]
description = Run unit tests with coverage
description = Run unit tests
deps = .[tests]
passenv = TRAVIS TRAVIS_*
commands = nosetests -v panel --with-coverage --cover-package=panel
commands = pytest panel

[_examples]
description = Test that default examples run
deps = .[recommended, tests]
commands = pytest --nbsmoke-run -k ".ipynb"
# could add more

[_examples_extra]
description = Test that all examples run
deps = .[examples_extra, tests]
commands = pytest --nbsmoke-run -k ".ipynb" --ignore-nbsmoke-skip-run

[_all_recommended]
description = Run all recommended tests
deps = .[recommended, tests]
commands = {[_flakes]commands}
{[_unit]commands}
# {[_examples]commands}
{[_examples]commands}

[_pkg]
commands = bokeh sampledata

[testenv]
# geoviews dependency cartopy and test dependency iris cannot be
# installed by pip alone, so provide access to site-packages and do
# not install deps with pip, but do install nose into virtualenv
# otherwise conda/system nose may be found
sitepackages = True
install_command = pip install --no-deps {opts} nose {packages}

changedir = {envtmpdir}

commands = examples-pkg: {[_pkg]commands}
unit: {[_unit]commands}
commands = unit: {[_unit]commands}
flakes: {[_flakes]commands}
examples: {[_examples]commands}
examples_extra: {[_examples_extra]commands}
all_recommended: {[_all_recommended]commands}

deps = unit: {[_unit]deps}
flakes: {[_flakes]deps}
examples: {[_examples]deps}
examples_extra: {[_examples_extra]deps}
all_recommended: {[_all_recommended]deps}

[pytest]
addopts = -v --pyargs --doctest-modules --doctest-ignore-import-errors
norecursedirs = doc .git dist build _build .ipynb_checkpoints
# depend on optional iris, xesmf, etc
#nbsmoke_skip_run = .*Homepage\.ipynb$
# .*Colocated_cube_pair\.ipynb$
# .*CubeExplorer_Prototype\.ipynb$
# .*user_guide/Resampling_Grids\.ipynb$
# .*user_guide/Gridded_Datasets_.*\.ipynb$
# .*gallery/bokeh/xarray_gridded\.ipynb$
# .*gallery/.*/xarray_image\.ipynb$
# .*gallery/.*/xarray_quadmesh\.ipynb$

nbsmoke_skip_run = .*Layouts\.ipynb$

[flake8]
include = *.py
# run_tests.py is generated by conda build, which appears to have a
Expand Down

0 comments on commit 5233c48

Please sign in to comment.