Got pytest working with bazel

This commit is contained in:
2022-09-13 21:24:34 -05:00
parent 6ff12bacf8
commit 77a4545496
5 changed files with 91 additions and 1 deletions

37
BUILD Normal file
View File

@@ -0,0 +1,37 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
load("@rules_python//python:defs.bzl", "py_library", "py_test")
load("@my_deps//:requirements.bzl", "requirement")
py_library(
name = "shillerben-homepage",
srcs = ["my_homepage/__init__.py"],
data = glob(["my_homepage/templates/*"]),
deps = [
requirement("click"),
requirement("Flask"),
requirement("gunicorn"),
requirement("itsdangerous"),
requirement("Jinja2"),
requirement("MarkupSafe"),
requirement("Werkzeug"),
]
)
py_test(
name = "website_test",
main = "test_website.py",
srcs = ["tests/test_website.py"],
deps = [
":shillerben-homepage",
requirement("pytest"),
],
)
container_push(
name = "push-image",
image = ":shillerben-homepage",
format = "Docker",
registry = "docker.shillerben.com",
repository = "shillerben-homepage",
tag = "latest",
)