summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--WORKSPACE20
-rw-r--r--glucometerutils/BUILD23
-rw-r--r--test/BUILD12
-rw-r--r--third_party/six.BUILD14
5 files changed, 74 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 894b10a..37e0dea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,8 @@
/MANIFEST
/dist/
__pycache__/
+/bazel-bin
+/bazel-genfiles
+/bazel-glucometerutils
+/bazel-out
+/bazel-testlogs
diff --git a/WORKSPACE b/WORKSPACE
new file mode 100644
index 0000000..5bd7c82
--- /dev/null
+++ b/WORKSPACE
@@ -0,0 +1,20 @@
+# -*- python -*-
+
+http_archive(
+ name = "abseil_py_archive",
+ strip_prefix = "abseil-py-9dd9c42657fee7f4022d625e39ca0f1f25ce265e",
+ urls = ["https://github.com/abseil/abseil-py/archive/9dd9c42657fee7f4022d625e39ca0f1f25ce265e.zip"]
+)
+
+# From abseil-py (neeeded as transitive dependency).
+# Copyright 2017 The Abseil Authors.
+new_http_archive(
+ name = "six_archive",
+ urls = [
+ "http://mirror.bazel.build/pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
+ "https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
+ ],
+ sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
+ strip_prefix = "six-1.10.0",
+ build_file = "third_party/six.BUILD",
+)
diff --git a/glucometerutils/BUILD b/glucometerutils/BUILD
new file mode 100644
index 0000000..6b3c267
--- /dev/null
+++ b/glucometerutils/BUILD
@@ -0,0 +1,23 @@
+# -*- python -*-
+
+package(
+ default_visibility = [
+ "//glucometerutils:__subpackages__",
+ "//test:__pkg__",
+ ]
+)
+
+py_library(
+ name = "exceptions",
+ srcs = ["exceptions.py"],
+ srcs_version = "PY3",
+)
+
+py_library(
+ name = "common",
+ srcs = ["common.py"],
+ srcs_version = "PY3",
+ deps = [
+ ":exceptions",
+ ]
+)
diff --git a/test/BUILD b/test/BUILD
new file mode 100644
index 0000000..e760b32
--- /dev/null
+++ b/test/BUILD
@@ -0,0 +1,12 @@
+# -*- python -*-
+
+py_test(
+ name = "test_common",
+ srcs = ["test_common.py"],
+ srcs_version = "PY3",
+ deps = [
+ "//glucometerutils:common",
+ "@abseil_py_archive//absl/testing:parameterized",
+ ],
+ default_python_version = "PY3",
+)
diff --git a/third_party/six.BUILD b/third_party/six.BUILD
new file mode 100644
index 0000000..a1b2f7b
--- /dev/null
+++ b/third_party/six.BUILD
@@ -0,0 +1,14 @@
+# Description:
+# Six provides simple utilities for wrapping over differences between Python 2
+# and Python 3.
+
+licenses(["notice"]) # MIT
+
+exports_files(["LICENSE"])
+
+py_library(
+ name = "six",
+ srcs = ["six.py"],
+ srcs_version = "PY2AND3",
+ visibility = ["//visibility:public"],
+)