diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 000000000..832745d71 --- /dev/null +++ b/.bazelrc @@ -0,0 +1,18 @@ +#Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +build --verbose_failures +test --keep_going +test --build_tests_only +test --test_output=errors +test --test_verbose_timeout_warnings \ No newline at end of file diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..e3029582f --- /dev/null +++ b/.flake8 @@ -0,0 +1,43 @@ +#Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +[flake8] +inline-quotes = double +max-line-length = 88 +max-complexity = 10 +exclude = .git, + .tox, + .pytest_cache, + __pycache__ +ignore = C901, + E101, + E111, + E114, + E121, + E125, + E126, + E129, + E221, + E265, + E271, + E305, + E306, + E501, + E502, + E731, + E741, + F401, + F812, + W191, + W503, + W504, \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d6b41feaa..87cb70ee7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,19 +12,43 @@ # See the License for the specific language governing permissions and # limitations under the License. language: python -python: - - "2.7" - - "3.5" - - "3.6" -install: - - pip install -U pip + +before_install: + - wget -O install.sh "https://github.com/bazelbuild/bazel/releases/download/0.26.1/bazel-0.26.1-installer-linux-x86_64.sh" + - chmod +x install.sh + - ./install.sh --user + - rm -f install.sh + - sudo apt-get -y install libopenexr-dev + - sudo apt-get -y install libgles2-mesa-dev + - sudo apt-get -y install libc-ares-dev + - pip install -U absl-py + - pip install -U scipy + - pip install -U OpenEXR + - pip install -U flake8 - pip install -U python-coveralls - - pip install -U tox-travis - - pip install -U tox-pip-version + +jobs: + include: + - os: linux + python: 2.7 + install: + - pip install -U tensorflow + - os: linux + python: 3.6 + install: + - pip install -U tensorflow + - os: linux + python: 3.6 + install: + - pip install -U tf-nightly-2.0-preview + script: - - tox + - bazel test //tensorflow_graphics/... + - flake8 --config=.flake8 ./tensorflow_graphics/ + after_success: - coveralls + notifications: email: recipients: diff --git a/tox.ini b/tox.ini deleted file mode 100644 index aa7a5abdc..000000000 --- a/tox.ini +++ /dev/null @@ -1,84 +0,0 @@ -#Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -[tox] -# Defines test environments for Python 2.7 and 3.6 with TensorFlow CPU and -# GPU, and also flake8 style guide enforcement. -envlist = py{27,35,36}-tf{CPU,GPU,NightlyCPU,NightlyGPU}, flake8 - -[testenv] -pip_version = pip -install_command = pip install -U {opts} {packages} -deps = - tfCPU: .[tf] # TensorFlow CPU package defined in setup.py. - tfGPU: .[tf-gpu] # TensorFlow GPU package defined in setup.py. - tfNightlyCPU: .[tf-nightly] # tf-nightly CPU package defined in setup.py. - tfNightlyGPU: .[tf-nightly-gpu] # tf-nightly GPU package defined in setup.py. - .[test] # Test packaged in setup.py. -whitelist_externals = - apt-get - coverage - pip - sudo -commands = - sudo apt-get -y install libopenexr-dev - pip install -U OpenEXR - coverage run --source tensorflow_graphics -m py.test {posargs} - -[testenv:flake8] -pip_version = pip -install_command = pip install -U {opts} {packages} -deps = flake8 -whitelist_externals = flake8 -commands = flake8 ./tensorflow_graphics/ - -[travis] -python = - 2.7: py27 - 3.5: py35 - 3.6: py36, flake8 - -[pytest] -addopts = --verbose -python_files = *_test.py -testpaths = ./tensorflow_graphics/ - -[flake8] -inline-quotes = double -max-line-length = 88 -max-complexity = 10 -exclude = .git, - .tox, - .pytest_cache, - __pycache__ -ignore = C901, - E101, - E111, - E114, - E121, - E125, - E126, - E129, - E221, - E265, - E271, - E305, - E306, - E501, - E502, - E731, - E741, - F401, - W191, - W503, - W504,