diff --git a/projects/templater/BUILD b/projects/templater/BUILD new file mode 100644 index 0000000..955f16a --- /dev/null +++ b/projects/templater/BUILD @@ -0,0 +1,9 @@ +zapp_binary( + name = "templater", + main = "templater.py", + deps = [ + py_requirement("click"), + py_requirement("jinja2"), + py_requirement("PyYAML"), + ] +) diff --git a/tools/python/templater.py b/projects/templater/templater.py similarity index 100% rename from tools/python/templater.py rename to projects/templater/templater.py diff --git a/tools/autoflake/BUILD b/tools/autoflake/BUILD new file mode 100644 index 0000000..34fd3ed --- /dev/null +++ b/tools/autoflake/BUILD @@ -0,0 +1,7 @@ +py_binary( + name = "autoflake", + main = "__main__.py", + deps = [ + py_requirement("autoflake"), + ] +) diff --git a/tools/python/autoflake_shim.py b/tools/autoflake/__main__.py similarity index 100% rename from tools/python/autoflake_shim.py rename to tools/autoflake/__main__.py diff --git a/tools/isort/BUILD b/tools/isort/BUILD new file mode 100644 index 0000000..76881ad --- /dev/null +++ b/tools/isort/BUILD @@ -0,0 +1,7 @@ +py_binary( + name = "isort", + main = "__main__.py", + deps = [ + py_requirement("isort"), + ] +) diff --git a/tools/python/isort_shim.py b/tools/isort/__main__.py similarity index 100% rename from tools/python/isort_shim.py rename to tools/isort/__main__.py diff --git a/tools/python/BUILD b/tools/python/BUILD index 9631375..9181e39 100644 --- a/tools/python/BUILD +++ b/tools/python/BUILD @@ -32,35 +32,6 @@ toolchain( toolchain_type = "@bazel_tools//tools/python:toolchain_type", ) -py_binary( - name = "autoflake", - main = "autoflake_shim.py", - deps = [ - py_requirement("autoflake"), - ] -) - -py_binary( - name = "isort", - main = "isort_shim.py", - deps = [ - py_requirement("isort"), - ] -) - -py_binary( - name = "sphinx", - main = "sphinx_shim.py", - deps = [ - py_requirement("click"), - py_requirement("recommonmark"), - py_requirement("sphinx"), - py_requirement("sphinxcontrib-openapi"), - py_requirement("sphinxcontrib-programoutput"), - py_requirement("livereload"), - ] -) - py_pytest( name = "test_licenses", srcs = [ @@ -75,14 +46,6 @@ py_pytest( ] ) -py_binary( - name = "unify", - main = "unify_shim.py", - deps = [ - py_requirement("unify"), - ] -) - py_binary( name = "openapi", main = "openapi_shim.py", @@ -90,32 +53,3 @@ py_binary( py_requirement("openapi-spec-validator"), ] ) - -# WARNING: YAMLLINT is GLP3'd code. Do not extend, modify or depend on this as a lib. -py_binary( - name = "yamllint", - main = "yamllint_shim.py", - deps = [ - py_requirement("yamllint"), - ] -) - -py_binary( - name = "templater", - main = "templater.py", - deps = [ - py_requirement("click"), - py_requirement("jinja2"), - py_requirement("PyYAML"), - ] -) - -py_binary( - name = "xfmt", - main = "xfmt.py", - deps = [ - py_requirement("beautifulsoup4"), - py_requirement("click"), - py_requirement("lxml"), - ] -) diff --git a/tools/sphinx/BUILD b/tools/sphinx/BUILD new file mode 100644 index 0000000..8fbf928 --- /dev/null +++ b/tools/sphinx/BUILD @@ -0,0 +1,12 @@ +py_binary( + name = "sphinx", + main = "__main__.py", + deps = [ + py_requirement("click"), + py_requirement("recommonmark"), + py_requirement("sphinx"), + py_requirement("sphinxcontrib-openapi"), + py_requirement("sphinxcontrib-programoutput"), + py_requirement("livereload"), + ] +) diff --git a/tools/python/sphinx_shim.py b/tools/sphinx/__main__.py similarity index 100% rename from tools/python/sphinx_shim.py rename to tools/sphinx/__main__.py diff --git a/tools/unify/BUILD b/tools/unify/BUILD new file mode 100644 index 0000000..ef86bd2 --- /dev/null +++ b/tools/unify/BUILD @@ -0,0 +1,7 @@ +py_binary( + name = "unify", + main = "__main__.py", + deps = [ + py_requirement("unify"), + ] +) diff --git a/tools/python/unify_shim.py b/tools/unify/__main__.py similarity index 100% rename from tools/python/unify_shim.py rename to tools/unify/__main__.py diff --git a/tools/xfmt/BUILD b/tools/xfmt/BUILD new file mode 100644 index 0000000..f859712 --- /dev/null +++ b/tools/xfmt/BUILD @@ -0,0 +1,9 @@ +py_binary( + name = "xfmt", + main = "__main__.py", + deps = [ + py_requirement("beautifulsoup4"), + py_requirement("click"), + py_requirement("lxml"), + ] +) diff --git a/tools/python/xfmt.py b/tools/xfmt/__main__.py similarity index 100% rename from tools/python/xfmt.py rename to tools/xfmt/__main__.py diff --git a/tools/yamllint/BUILD b/tools/yamllint/BUILD new file mode 100644 index 0000000..6e5e23b --- /dev/null +++ b/tools/yamllint/BUILD @@ -0,0 +1,8 @@ +# WARNING: YAMLLINT is GLP3'd code. Do not extend, modify or depend on this as a lib. +py_binary( + name = "yamllint", + main = "__main__.py", + deps = [ + py_requirement("yamllint"), + ] +) diff --git a/tools/python/yamllint_shim.py b/tools/yamllint/__main__.py similarity index 100% rename from tools/python/yamllint_shim.py rename to tools/yamllint/__main__.py