From d4555ec714ce317ada3da667371634342b295af8 Mon Sep 17 00:00:00 2001 From: Gonzalo Pena-Castellanos Date: Mon, 16 Jan 2017 14:38:44 -0500 Subject: [PATCH] Add circle ci basic integration --- .ciocheck | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++ circle.yml | 45 ++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 .ciocheck create mode 100644 circle.yml diff --git a/.ciocheck b/.ciocheck new file mode 100644 index 00000000..fb8ca064 --- /dev/null +++ b/.ciocheck @@ -0,0 +1,108 @@ +# ----------------------------------------------------------------------------- +# ciocheck +# https://github.com/ContinuumIO/ciocheck +# ----------------------------------------------------------------------------- +[ciocheck] +branch = origin/master +diff_mode = commited +file_mode = all +check = pep8 + +# Python (pyformat) +add_copyright = true +add_header = true +add_init = true + +# ----------------------------------------------------------------------------- +# pep8 +# http://pep8.readthedocs.io/en/latest/intro.html#configuration +# ----------------------------------------------------------------------------- +[pep8] +exclude = */tests/*,*/external/* +ignore = E126, +max-line-length = 79 + +# ----------------------------------------------------------------------------- +# pydocstyle +# http://www.pydocstyle.org/en/latest/usage.html#example +# ----------------------------------------------------------------------------- +[pydocstyle] +add-ignore = D203 +inherit = false + +# ----------------------------------------------------------------------------- +# Flake 8 +# http://flake8.readthedocs.io/en/latest/config.html +# ----------------------------------------------------------------------------- +[flake8] +exclude = */tests/*, +ignore = E126, +max-line-length = 79 +max-complexity = 64 + +# ----------------------------------------------------------------------------- +# pylint +# https://pylint.readthedocs.io/en/latest/ +# ----------------------------------------------------------------------------- +#[pylint:messages] + +# ----------------------------------------------------------------------------- +# isort +# https://github.com/timothycrosley/isort/wiki/isort-Settings +# ----------------------------------------------------------------------------- +[isort] +from_first = true +import_heading_stdlib = Standard library imports +import_heading_firstparty = Local imports +import_heading_thirdparty = Third party imports +indent = ' ' +known_first_party = spyder_notebook +known_third_party = qtpy, spyder +known_standard_library = mimetypes +line_length = 79 +sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER + +# ----------------------------------------------------------------------------- +# yapf +# https://github.com/google/yapf#formatting-style +# ----------------------------------------------------------------------------- +[yapf:style] +based_on_style = pep8 +column_limit = 79 +spaces_before_comment = 2 + +# ----------------------------------------------------------------------------- +# autopep8 +# http://pep8.readthedocs.io/en/latest/intro.html#configuration +# ----------------------------------------------------------------------------- +[autopep8] +exclude = + */tests/* +ignore = E126, +max-line-length = 79 + +# ----------------------------------------------------------------------------- +# Coverage +# http://coverage.readthedocs.io/en/latest/config.html +# ----------------------------------------------------------------------------- +[coverage:run] +omit = + */tests/* + */build/* + +[coverage:report] +fail_under = 0 +show_missing = true +skip_covered = true +exclude_lines = + pragma: no cover + def test(): + if __name__ == .__main__.: + +# ----------------------------------------------------------------------------- +# pytest +# http://doc.pytest.org/en/latest/usage.html +# ----------------------------------------------------------------------------- +[pytest] +addopts = -rfew --durations=10 +python_functions = test_* diff --git a/circle.yml b/circle.yml new file mode 100644 index 00000000..3c128cc5 --- /dev/null +++ b/circle.yml @@ -0,0 +1,45 @@ +# https://circleci.com/gh/spyder-ide/spyder-notebook/ + +machine: + environment: + # Python versions to tests (Maximum of 4 different versions) + PY_VERSIONS: "3.5 3.4 2.7" + + # Conda variables and aliases for commands + CMD_TEST_CIOCHECK: /home/ubuntu/miniconda/envs/test/bin/ciocheck + CMD_TEST_COVERALLS: /home/ubuntu/miniconda/envs/test/bin/coveralls + CMD_TEST_PIP: /home/ubuntu/miniconda/envs/test/bin/pip + CMD_TEST_PYTHON: /home/ubuntu/miniconda/envs/test/bin/python + MINICONDA: /home/ubuntu/miniconda + PATH: /home/ubuntu/miniconda/bin:$PATH + +dependencies: + override: + # Conda install + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - bash Miniconda3-latest-Linux-x86_64.sh -b -p $MINICONDA + - conda config --set always_yes True + + # Environment for tests + - export PY_VERSIONS=($PY_VERSIONS) && + export PYTHON_VERSION=${PY_VERSIONS[$CIRCLE_NODE_INDEX]} && + echo -e "PYTHON = $PYTHON_VERSION \n============" && + conda create -n test python=$PYTHON_VERSION -q; + #- conda install -n test --file requirements.txt -q + - "$CMD_TEST_PIP install coveralls" + + # Install python module + #- $CMD_TEST_PYTHON setup.py develop > /dev/null; + + # Environment for lint checks + - conda install -n test ciocheck -c spyder-ide -q --no-update-deps + +test: + override: + # Check Python style + - $CMD_TEST_CIOCHECK spyder_notebook -dt: # note the colon + parallel: true + + # Run Python tests + - $CMD_TEST_CIOCHECK spyder_notebook -dl -df: # note the colon + parallel: true