Skip to content

Instantly share code, notes, and snippets.

@vonschultz
Created August 18, 2023 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vonschultz/18b4e58a697d56c8cc421528e0a4ef13 to your computer and use it in GitHub Desktop.
Save vonschultz/18b4e58a697d56c8cc421528e0a4ef13 to your computer and use it in GitHub Desktop.
Bazel + mmh3 version 4.0.0 and version 4.0.1
load("@rules_python//python:defs.bzl", "py_test")
py_test(
name = "mmh3_400_test",
srcs = ["test.py"],
main = "test.py",
deps = ["@pip_dependencies_400_mmh3//:pkg"],
)
py_test(
name = "mmh3_401_test",
srcs = ["test.py"],
main = "test.py",
deps = ["@pip_dependencies_401_mmh3//:pkg"],
)
import unittest
import mmh3
class TestMMH3(unittest.TestCase):
def test_hello_world(self):
self.assertEqual(mmh3.hash("Hello World"), 427197390)
if __name__ == '__main__':
unittest.main()
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "0a8003b044294d7840ac7d9d73eef05d6ceb682d7516781a4ec62eeb34702578",
strip_prefix = "rules_python-0.24.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.24.0/rules_python-0.24.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
load("@rules_python//python:pip.bzl", "pip_parse")
pip_parse(
name = "pip_dependencies_400",
requirements_lock = "//:requirements_400.txt",
)
load("@pip_dependencies_400//:requirements.bzl", req400_install_deps = "install_deps")
req400_install_deps()
pip_parse(
name = "pip_dependencies_401",
requirements_lock = "//:requirements_401.txt",
)
load("@pip_dependencies_401//:requirements.bzl", req401_install_deps = "install_deps")
req401_install_deps()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment