-
-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Bazel Python library and test. (#882)
Usage: ``` py_binary( name = "py_example", srcs = ["py_example.py"], deps = ["@opencc//:py_opencc"] ) ```
- Loading branch information
Showing
10 changed files
with
131 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
load("@rules_python//python:py_library.bzl", "py_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
py_library( | ||
name = "opencc", | ||
srcs = ["__init__.py"], | ||
data = [ | ||
"//data/config", | ||
"//data/dictionary:binary_dictionaries", | ||
"//data/dictionary:text_dictionaries", | ||
], | ||
imports = [".."], | ||
deps = ["//src:py_opencc"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
load("@pip//:requirements.bzl", "requirement") | ||
load("@rules_python//python:py_test.bzl", "py_test") | ||
|
||
py_test( | ||
name = "test_opencc", | ||
srcs = ["test_opencc.py"], | ||
data = [ | ||
"//test/testcases", | ||
], | ||
imports = [".."], | ||
deps = [ | ||
"//python/opencc", | ||
requirement("pytest"), | ||
requirement("exceptiongroup"), | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
exceptiongroup==1.2.2 | ||
iniconfig==2.0.0 | ||
packaging==24.1 | ||
pluggy==1.5.0 | ||
pytest==8.3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters