-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bazelize bazel-bench #13
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
eafef02
First step
joeleba 28c9454
Merge branch 'master' into bazelize
joeleba 2d60692
Merge branch 'master' into bazelize
joeleba f574ae2
Setup test targets
joeleba 89c7e7e
tests for testutil
joeleba 9a9a725
Fix a random failing test
joeleba 1570ea7
Update readme
joeleba 5886d30
Move requirements.txt
joeleba 6084d23
Update README
joeleba b7d4432
rm git-db
joeleba 04fd8f6
Rm gitdb
joeleba a4ac5f0
Standardize BUILD indentation
joeleba 572d3b1
Update BUILD files
joeleba 13f7fdb
Merge branch 'master' into bazelize
joeleba b51bfa3
No more virtualenv and pip
joeleba 7a2d7e3
Add comments to clarify the need to do weird stuffs
joeleba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,6 @@ __pycache__/ | |
|
||
# Config file | ||
utils/config.py | ||
|
||
# Bazel | ||
bazel-* |
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,22 @@ | ||
load("@third_party//:requirements.bzl", "requirement") | ||
|
||
py_binary( | ||
name = "benchmark", | ||
srcs = ["benchmark.py"], | ||
deps = [ | ||
"//utils:utils", | ||
requirement('absl-py'), | ||
requirement('GitPython'), | ||
requirement('gitdb2') | ||
], | ||
) | ||
|
||
py_test( | ||
name = "benchmark_test", | ||
srcs = ["benchmark_test.py"], | ||
deps = [ | ||
":benchmark", | ||
"//testutils:testutils", | ||
requirement('mock') | ||
] | ||
) |
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,24 @@ | ||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") | ||
|
||
git_repository( | ||
name = "io_bazel_rules_python", | ||
remote = "https://github.com/bazelbuild/rules_python.git", | ||
commit = "965d4b4a63e6462204ae671d7c3f02b25da37941", | ||
) | ||
|
||
# Only needed for PIP support: | ||
load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories", "pip_import") | ||
|
||
pip_repositories() | ||
|
||
# This rule translates the specified requirements.txt into | ||
# @my_deps//:requirements.bzl, which itself exposes a pip_install method. | ||
pip_import( | ||
name = "third_party", | ||
requirements = "//third_party:requirements.txt", | ||
) | ||
|
||
# Load the pip_install symbol for my_deps, and create the dependencies' | ||
# repositories. | ||
load("@third_party//:requirements.bzl", "pip_install") | ||
pip_install() |
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,11 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "testutils-srcs", | ||
srcs = glob(["*.py"]) | ||
) | ||
|
||
py_library( | ||
name = "testutils", | ||
srcs = [":testutils-srcs"], | ||
) |
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 @@ | ||
exports_files(glob(["**"])) |
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,75 @@ | ||
load("@third_party//:requirements.bzl", "requirement") | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "utils-srcs", | ||
srcs = glob( | ||
["*.py"], | ||
exclude = ["*_test.py"] | ||
) | ||
) | ||
|
||
py_library( | ||
name = "utils", | ||
srcs = [":utils-srcs"], | ||
deps = [ | ||
requirement('absl-py'), | ||
requirement('cachetools'), | ||
requirement('certifi'), | ||
requirement('chardet'), | ||
requirement('enum34'), | ||
requirement('funcsigs'), | ||
requirement('futures'), | ||
# This is a workaround for https://github.com/bazelbuild/rules_python/issues/14, | ||
# google-cloud-bigquery must be listed first. | ||
requirement('google-cloud-bigquery'), | ||
requirement('google-api-core'), | ||
requirement('google-auth'), | ||
requirement('google-cloud-core'), | ||
requirement('google-resumable-media'), | ||
requirement('googleapis-common-protos'), | ||
requirement('idna'), | ||
requirement('numpy'), | ||
requirement('pbr'), | ||
requirement('protobuf'), | ||
requirement('psutil'), | ||
requirement('pyasn1'), | ||
requirement('pyasn1-modules'), | ||
requirement('pytz'), | ||
requirement('requests'), | ||
requirement('rsa'), | ||
requirement('scipy'), | ||
requirement('six'), | ||
requirement('urllib3') | ||
] | ||
) | ||
|
||
py_test( | ||
name = "bazel_args_parser_test", | ||
size = "small", | ||
srcs = ["bazel_args_parser_test.py"], | ||
deps = [ | ||
":utils", | ||
requirement('mock'), | ||
] | ||
) | ||
|
||
py_test( | ||
name = "bazel_test", | ||
size = "small", | ||
srcs = ["bazel_test.py"], | ||
deps = [ | ||
":utils", | ||
requirement('mock'), | ||
] | ||
) | ||
|
||
py_test( | ||
name = "values_test", | ||
size = "small", | ||
srcs = ["values_test.py"], | ||
deps = [ | ||
":utils", | ||
requirement('mock'), | ||
] | ||
) |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the motivation to move this import down here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a workaround of bazelbuild/rules_python#14 for
bazel test
to work.