-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from EmanueleGhelfi/pipelines
Setup Travis and codecov
- Loading branch information
Showing
4 changed files
with
144 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
dist: xenial | ||
language: python | ||
addons: | ||
artifacts: true | ||
python: | ||
- '3.7' | ||
stages: | ||
- Tests | ||
- Black | ||
- Pylint | ||
- Deploy | ||
before_install: | ||
- sudo apt-get install -y --no-install-recommends bc | ||
addons: | ||
apt: | ||
update: true | ||
install: &requirements | ||
- pip install -r dev-requirements.txt | ||
- pip install -e . | ||
jobs: | ||
include: | ||
- stage: Tests | ||
install: *requirements | ||
script: | ||
- pip install codecov | ||
- pip --no-cache-dir install --upgrade git+https://github.com/thisch/pytest-sphinx.git pytest | ||
- pip --no-cache-dir install pytest-cov | ||
- module="" | ||
- for d in $(ls -d */); do if [ -f "$d"__init__.py ]; then module=${d::-1}; fi | ||
done | ||
- pytest -x -s -vvv --doctest-modules $module --cov=$module | ||
after_success: | ||
- codecov | ||
- stage: Black | ||
install: *requirements | ||
script: | ||
- echo excluding $(git config --file .gitmodules --get-regexp path | awk '{ print | ||
$2 }') | ||
- black --exclude $(git config --file .gitmodules --get-regexp path | awk '{ print | ||
$2 }') --check . | ||
- stage: Pylint | ||
install: *requirements | ||
script: | ||
- pip --no-cache-dir install pylint-runner | ||
- pylint_runner --rcfile=.pylintrc --output-format=text . | tee pylint.txt | ||
- score=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.txt) | ||
- if (( $(echo "$score < 8" |bc -l) )); then echo "Your Pylint score is too low, $score < 8!"; exit 1; fi | ||
- stage: Deploy | ||
script: skip | ||
deploy: | ||
provider: pypi | ||
user: emanueleghelfi | ||
password: | ||
secure: S6XvndLnBDs64vjouhjw1l5N1eAMrCfxZt64KnNdJnn481BBoaEzY/CNV5Bp4GqPi8T7vu+AY78yT1LPT5YNazya0ywo2p3KCeQSQpgzz3gTjLbsKA6q0YXiNeLtw9X5xmpV5RoqR06+zukf8Hs/gk6HGpvW2SKG9FhTTSLKzmR4G9VJaveb9vZ8FaoK8lpuRyEYbneM92artjVV9eCYUXXa/1fNJPRhGW+q/mShtCrL/2zEVDCCXZ8oY3KgW1zNXUoPKDtg+o20002FveYrUw/0AofTMQutz+tkyvsNed3mWctA+W2YFohF70OgdiyeN8UCWWPqNOAnvvOFsWH0KSBvDmR/YUaGzk59v7WYG677j2uwD5AdZSvAMJjVqJ3D+HoHPgGj5IWpj/Ncyn65/7uQNvG4oD6i7BDKeqGoCgXTK+8TqkdzIRQEemQ4kEmbHy5EoZdQwZBASWct+jtM2hTBkkZaOwbQgKk7I+Q5RXlzg8BoNZKZGtZSG5HM5JV4b6SUUDjE/JWukHh3V1hVtgtha9yefN4TwrZ8mG0ntfsr7aPwYvmNjUi0hcdgV+/IsmHdn/fsGUfzvr8aW20aG3FeGiKO8tPAzieIHDywDBZa+tKFck1Uvei5x/nK10pSEo0zFDC3p/HjBGnoB8+JPT/TeCWrfRQW5klsPiLZ3hU= | ||
on: | ||
tags: true | ||
all_branches: true | ||
# deploy only if tag respects semantic versioning pre-pended with v (e.g. v0.1.0) | ||
if: tag =~ /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Core packages | ||
# uncomment the following line to install the gpu-version | ||
# tensorflow-gpu==2.0.0b1 | ||
tensorflow==2.0.0b1 | ||
tensorflow_hub | ||
|
||
# Code Style | ||
black | ||
pylint | ||
flake8 | ||
isort | ||
rope | ||
mypy | ||
|
||
# Testing | ||
pytest | ||
|
||
# pytest-sphix | ||
#git+https://github.com/thisch/pytest-sphinx.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# This file is autogenerated by pip-compile | ||
# To update, run: | ||
# | ||
# pip-compile --output-file=dev-requirements.txt --pre dev-requirements.in | ||
# | ||
absl-py==0.7.1 # via tb-nightly, tensorflow | ||
appdirs==1.4.3 # via black | ||
astor==0.8.0 # via tensorflow | ||
astroid==2.2.5 # via pylint | ||
atomicwrites==1.3.0 # via pytest | ||
attrs==19.1.0 # via black, pytest | ||
black==19.3b0 | ||
click==7.0 # via black | ||
entrypoints==0.3 # via flake8 | ||
flake8==3.7.8 | ||
gast==0.2.2 # via tensorflow | ||
google-pasta==0.1.7 # via tensorflow | ||
grpcio==1.22.0 # via tb-nightly, tensorflow | ||
h5py==2.9.0 # via keras-applications | ||
importlib-metadata==0.18 # via pluggy, pytest | ||
isort==4.3.21 | ||
keras-applications==1.0.8 # via tensorflow | ||
keras-preprocessing==1.1.0 # via tensorflow | ||
lazy-object-proxy==1.4.1 # via astroid | ||
markdown==3.1.1 # via tb-nightly | ||
mccabe==0.6.1 # via flake8, pylint | ||
more-itertools==7.1.0 # via pytest | ||
mypy-extensions==0.4.1 # via mypy | ||
mypy==0.720 | ||
numpy==1.16.4 # via h5py, keras-applications, keras-preprocessing, tb-nightly, tensorflow, tensorflow-hub | ||
packaging==19.0 # via pytest | ||
pluggy==0.12.0 # via pytest | ||
protobuf==3.9.0 # via tb-nightly, tensorflow, tensorflow-hub | ||
py==1.8.0 # via pytest | ||
pycodestyle==2.5.0 # via flake8 | ||
pyflakes==2.1.1 # via flake8 | ||
pylint==2.3.1 | ||
pyparsing==2.4.0 # via packaging | ||
pytest==5.0.1 | ||
rope==0.14.0 | ||
six==1.12.0 # via absl-py, astroid, grpcio, h5py, keras-preprocessing, packaging, protobuf, tb-nightly, tensorflow, tensorflow-hub | ||
tb-nightly==1.14.0a20190603 # via tensorflow | ||
tensorflow-hub==0.5.0 | ||
tensorflow==2.0.0b1 | ||
termcolor==1.1.0 # via tensorflow | ||
tf-estimator-nightly==1.14.0.dev2019060501 # via tensorflow | ||
toml==0.10.0 # via black | ||
typed-ast==1.4.0 # via astroid, mypy | ||
typing-extensions==3.7.4 # via mypy | ||
wcwidth==0.1.7 # via pytest | ||
werkzeug==0.15.4 # via tb-nightly | ||
wheel==0.33.4 # via tb-nightly, tensorflow | ||
wrapt==1.11.2 # via astroid, tensorflow | ||
zipp==0.5.2 # via importlib-metadata | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
# setuptools==41.0.1 # via markdown, protobuf, tb-nightly |