diff --git a/WORKSPACE b/WORKSPACE index 07f84eb1d6..d62ea20591 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -107,3 +107,15 @@ load( ) _version_install() + +pip_import( + name = "examples_boto", + requirements = "//examples/boto:requirements.txt", +) + +load( + "@examples_boto//:requirements.bzl", + _boto_install = "pip_install", +) + +_boto_install() diff --git a/examples/boto/BUILD b/examples/boto/BUILD new file mode 100644 index 0000000000..0f22871063 --- /dev/null +++ b/examples/boto/BUILD @@ -0,0 +1,25 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# 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 +# +# http://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. +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) # Apache 2.0 + +load("@examples_boto//:requirements.bzl", "requirement") +load("//python:python.bzl", "py_test") + +py_test( + name = "boto_test", + srcs = ["boto_test.py"], + deps = [requirement("boto3")], +) diff --git a/examples/boto/boto_test.py b/examples/boto/boto_test.py new file mode 100644 index 0000000000..8de0e3e7c6 --- /dev/null +++ b/examples/boto/boto_test.py @@ -0,0 +1,26 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# 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 +# +# http://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. + +import boto3 +import unittest + + +class BotoTest(unittest.TestCase): + + def test_version(self): + self.assertEqual(boto3.__version__, '1.4.7') + + +if __name__ == '__main__': + unittest.main() diff --git a/examples/boto/requirements.txt b/examples/boto/requirements.txt new file mode 100644 index 0000000000..2e58c78db0 --- /dev/null +++ b/examples/boto/requirements.txt @@ -0,0 +1 @@ +boto3==1.4.7 diff --git a/rules_python/whl.py b/rules_python/whl.py index 83c4d0d5fb..2905d77408 100644 --- a/rules_python/whl.py +++ b/rules_python/whl.py @@ -79,7 +79,7 @@ def dependencies(self): requires = requirement.get('requires', []) for entry in requires: # Strip off any trailing versioning data. - parts = entry.split(' ', 1) + parts = re.split('[ ><=()]', entry) yield parts[0] def expand(self, directory): diff --git a/tools/piptool.par b/tools/piptool.par index 46da2181ae..ba7fb26eae 100755 Binary files a/tools/piptool.par and b/tools/piptool.par differ