Skip to content

Commit

Permalink
fix travis-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Jul 17, 2019
1 parent 96be511 commit 8b1d115
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 76 deletions.
29 changes: 19 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,31 @@ env:
matrix:
fast_finish: true
include:
- name: default
- name: "python-3.6"
env: PY=3.6
- name: "python-3.7"
env: PY=3.7
- name: coding_standards
env: PY=3.7
- name: docs
env: PY=3.7
- name: "tarball"
env: PY=3.7

before_install:
# Install miniconda and create TEST env.
- |
wget http://bit.ly/miniconda -O miniconda.sh
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -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 update --quiet conda
conda config --add channels conda-forge --force
conda install 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
conda info --all
# Install firefox headless driver.
- |
wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz -O geckodriver.tar.gz
Expand All @@ -44,17 +48,22 @@ before_install:
export PATH=$PATH:$PWD/geckodriver
install:
- python setup.py sdist && version=$(python setup.py --version) && pushd dist && pip install --no-deps --force-reinstall branca-${version}.tar.gz && popd
- pip install -e . --no-deps --force-reinstall

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

- if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then
pip wheel . -w dist --no-deps ;
check-manifest --verbose ;
twine check dist/* ;
fi

- if [[ $TRAVIS_JOB_NAME == 'coding_standards' ]]; then
flake8 --max-line-length=105 branca --exclude=_version.py ;
flake8 --max-line-length=105 tests ;
pytest --flake8 -m flake8 ;
fi

- if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then
Expand Down Expand Up @@ -82,4 +91,4 @@ deploy:
repo: python-visualization/branca
tags: true
all_branches: master
condition: '$TEST_TARGET == "default"'
condition: '$TEST_TARGET == "docs"'
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[![PyPI Package](https://img.shields.io/pypi/v/branca.svg)](https://pypi.python.org/pypi/branca) [![Build Status](https://travis-ci.org/python-visualization/branca.svg?branch=master)](https://travis-ci.org/python-visualization/branca) [![Gitter](https://badges.gitter.im/python-visualization/folium.svg)](https://gitter.im/python-visualization/folium)

# Branca

This library is a spinoff from [folium](https://github.com/python-visualization/folium),
that would host the non-map-specific features.

It may become a HTML+JS generation library in the future.

It is based on Jinja2 only.

There's no documentation,
but you can [browse the examples](http://nbviewer.jupyter.org/github/python-visualization/branca/tree/master/examples) gallery.
27 changes: 0 additions & 27 deletions README.rst

This file was deleted.

15 changes: 8 additions & 7 deletions branca/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import

import sys

import branca.colormap as colormap
Expand All @@ -13,21 +14,21 @@
if sys.version_info < (3, 0):
raise ImportError(
"""You are running branca {} on Python 2
branca 0.4 and above are no longer compatible with Python 2, but somehow
you got this version anyway. Make sure you have pip >= 9.0 to avoid this
kind of issue, as well as setuptools >= 24.2:
$ pip install pip setuptools --upgrade
Your choices:
- Upgrade to Python 3.
- Install an older version of branca:
$ pip install 'branca<0.4.0'
""".format(__version__)) # noqa


Expand Down
7 changes: 6 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
check-manifest
flake8
flake8-builtins
flake8-comprehensions
flake8-import-order
flake8-mutable
flake8-print
flake8-quotes
nbsphinx
pylint
pytest
pytest-cov
pytest-flake8
pytest-xdist
selenium
sphinx
twine
wheel
24 changes: 24 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,27 @@ versionfile_source = branca/_version.py
versionfile_build = branca/_version.py
tag_prefix = v
parentdir_prefix =

[tool:pytest]
flake8-max-line-length = 105
flake8-ignore =
docs/* ALL
versioneer.py ALL
branca/_version.py ALL

[metadata]
description-file = README.rst
license_file = LICENSE.txt

[check-manifest]
ignore =
.*.yml
.coveragerc
Makefile
docs
docs/*
*.enc
examples
examples/*
tests
tests/*
67 changes: 36 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import os
import sys

Expand All @@ -11,12 +9,12 @@


def read(*parts):
return open(os.path.join(rootpath, *parts), 'r').read()
return open(os.path.join(rootpath, *parts), "r").read()


def walk_subpkg(name):
data_files = []
package_dir = 'branca'
package_dir = "branca"
for parent, dirs, files in os.walk(os.path.join(package_dir, name)):
# Remove package_dir from the path.
sub_dir = os.sep.join(parent.split(os.sep)[1:])
Expand All @@ -37,51 +35,58 @@ def walk_subpkg(name):
Python {py} detected.
Try upgrading pip and retry.
""".format(py='.'.join([str(v) for v in sys.version_info[:3]]))
print(error, file=sys.stderr)
""".format(
py=".".join([str(v) for v in sys.version_info[:3]])
)
print(error, file=sys.stderr) # noqa
sys.exit(1)

pkg_data = {'': ['*.js',
'plugins/*.js',
'plugins/*.html',
'plugins/*.css',
'plugins/*.tpl',
'templates/*.html',
'templates/*.js',
'templates/*.txt']}
pkgs = ['branca', ]

LICENSE = read('LICENSE.txt')
long_description = '{}\n{}'.format(read('README.rst'), read('CHANGES.txt'))
pkg_data = {
"": [
"*.js",
"plugins/*.js",
"plugins/*.html",
"plugins/*.css",
"plugins/*.tpl",
"templates/*.html",
"templates/*.js",
"templates/*.txt",
]
}
pkgs = ["branca"]

LICENSE = read("LICENSE.txt")
long_description = "{}".format(read("README.md"))

# Dependencies.
with open('requirements.txt') as f:
with open("requirements.txt") as f:
tests_require = f.readlines()
install_requires = [t.strip() for t in tests_require]


setup(
name='branca',
name="branca",
version=versioneer.get_version(),
description='Generate complex HTML+JS pages with Python',
description="Generate complex HTML+JS pages with Python",
long_description=long_description,
author='Martin Journois',
url='https://github.com/python-visualization/branca',
keywords='data visualization',
long_description_content_type="text/markdown",
author="Martin Journois",
url="https://github.com/python-visualization/branca",
keywords="data visualization",
classifiers=[
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: MIT License',
'Development Status :: 5 - Production/Stable'
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: MIT License",
"Development Status :: 5 - Production/Stable",
],
packages=pkgs,
package_data=pkg_data,
include_package_data=True,
cmdclass=versioneer.get_cmdclass(),
tests_require=['pytest'],
tests_require=["pytest"],
license=LICENSE,
install_requires=install_requires,
python_requires='>=3.5',
python_requires=">=3.5",
zip_safe=False,
)

0 comments on commit 8b1d115

Please sign in to comment.