From 15c741751603d99f6576ad2e36108b83c925c4bc Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Sat, 21 Aug 2021 17:25:19 -0600 Subject: [PATCH] Blah. --- projects/lilith/BUILD | 14 +++++++++++--- tools/python/defs.bzl | 23 ++--------------------- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/projects/lilith/BUILD b/projects/lilith/BUILD index a972505..0935c95 100644 --- a/projects/lilith/BUILD +++ b/projects/lilith/BUILD @@ -1,11 +1,19 @@ py_project( - name = "lilith", - main = "src/python/lilith/__main__.py", + name = "lib", lib_deps = [ py_requirement("lark"), - py_requirement("prompt_toolkit"), ], test_deps = [ py_requirement("hypothesis"), ], ) + +zapp_binary( + name = "lilith", + main = "src/python/lilith/__main__.py", + deps = [ + ":lib", + py_requirement("lark"), # FIXME: Absolutely a zapp bug + py_requirement("prompt_toolkit"), + ], +) diff --git a/tools/python/defs.bzl b/tools/python/defs.bzl index 3c38621..edc4a91 100644 --- a/tools/python/defs.bzl +++ b/tools/python/defs.bzl @@ -146,7 +146,6 @@ py_resources = rule( ) def py_project(name=None, - main=None, lib_srcs=None, lib_deps=None, lib_data=None, @@ -185,10 +184,8 @@ def py_project(name=None, "**/*.pyc", ]) - lib_name = name if not main else "lib" - py_library( - name=lib_name, + name=name, srcs=lib_srcs, deps=lib_deps, data=lib_data, @@ -201,28 +198,12 @@ def py_project(name=None, ], ) - if main: - py_binary( - name = name, - main = main, - imports=[ - "src/python", - "src/resources", - ], - deps=[ - lib_name, - ], - visibility = [ - "//visibility:public", - ], - ) - for src in test_srcs: if "test_" in src: py_pytest( name=src.split("/")[-1], srcs=[src] + [f for f in test_srcs if "test_" not in f], - deps=[lib_name] + (test_deps or []), + deps=[name] + (test_deps or []), data=test_data, imports=[ "test/python",