8000 Address review comments · bazel-contrib/rules_python@3e43501 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3e43501

Browse files
committed
Address review comments
1 parent 0ce9a7a commit 3e43501

File tree

5 files changed

+19
-61
lines changed

5 files changed

+19
-61
lines changed

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# This lets us glob() up all the files inside the examples to make them inputs to tests
44
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
55
# To update these lines, run tools/bazel_integration_test/update_deleted_packages.sh
6-
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/multi_python_versions,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_import,examples/relative_requirements,tests/compile_pip_requirements,tests/pip_repository_entry_points,tests/pip_deps
7-
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/multi_python_versions,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_import,examples/relative_requirements,tests/compile_pip_requirements,tests/pip_repository_entry_points,tests/pip_deps
6+
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/get_url,examples/bzlmod,examples/multi_python_versions,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_import,examples/relative_requirements,tests/compile_pip_requirements,tests/pip_repository_entry_points,tests/pip_deps
7+
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/get_url,examples/bzlmod,examples/multi_python_versions,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_import,examples/relative_requirements,tests/compile_pip_requirements,tests/pip_repository_entry_points,tests/pip_deps
88

99
test --test_output=errors
1010

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,5 @@ user.bazelrc
4343
*.swp
4444
*.swo
4545

46-
# Go/Gazelle files
47-
# These otherwise match patterns above
48-
!go.mod
49-
!BUILD.out
50-
5146
# Python cache
5247
**/__pycache__/

examples/build_file_generation/WORKSPACE

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ local_repository(
6767
path = "../..",
6868
)
6969

70-
local_repository(
71-
name = "rules_python_gazelle_plugin",
72-
path = "../../gazelle",
73-
)
74-
7570
# When not using this example in the rules_python git repo you would load the python
7671
# ruleset using the following StarLark.
7772
# See https://github.com/bazelbuild/rules_python#getting-started for the latest
@@ -86,14 +81,22 @@ local_repository(
8681
# strip_prefix = "rules_python-0.16.1",
8782
# url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.16.1.tar.gz",
8883
# )
84+
85+
# We import the repository-local rules_python_gazelle_plugin version in order to
86+
# be able to test development changes to the plugin.
87+
local_repository(
88+
name = "rules_python_gazelle_plugin",
89+
path = "../../gazelle",
90+
)
91+
92+
# When loading the gazelle plugin outside this repo, use the http_archive rule as follows:
8993
#
90-
# load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
91-
# http_archive(
92-
# name = "rules_python_gazelle_plugin",
93-
# sha256 = "497ca47374f48c8b067d786b512ac10a276211810f4a580178ee9b9ad139323a",
94-
# strip_prefix = "rules_python-0.16.1/gazelle",
95-
# url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.16.1.tar.gz",
96-
# )
94+
#http_archive(
95+
# name = "rules_python_gazelle_plugin",
96+
# sha256 = "497ca47374f48c8b067d786b512ac10a276211810f4a580178ee9b9ad139323a",
97+
# strip_prefix = "rules_python-0.16.1/gazelle",
98+
# url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.16.1.tar.gz",
99+
#)
97100

98101
# Next we load the toolchain from rules_python.
99102
load("@rules_python//python:repositories.bzl", "python_register_toolchains")

gazelle/.gitignore

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
1-
# Compiled Object files
2-
*.slo
3-
*.lo
4-
*.o
5-
*.obj
6-
7-
# Precompiled Headers
8-
*.gch
9-
*.pch
10-
11-
# Compiled Dynamic libraries
12-
*.so
13-
*.dylib
14-
*.dll
15-
16-
# Fortran module files
17-
*.mod
18-
*.smod
19-
20-
# Compiled Static libraries
21-
*.lai
22-
*.la
23-
*.a
24-
*.lib
25-
26-
# Executables
27-
*.exe
28-
*.out
29-
*.app
30-
31-
# Emacs garbage
32-
*~
33-
341
# Bazel directories
352
/bazel-*
363
/bazel-bin
@@ -39,14 +6,7 @@
396
/bazel-testlogs
407
user.bazelrc
418

42-
# vim swap files
43-
*.swp
44-
*.swo
45-
469
# Go/Gazelle files
4710
# These otherwise match patterns above
4811
!go.mod
4912
!BUILD.out
50-
51-
# Python cache
52-
**/__pycache__/

gazelle/python/python_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import (
3838
)
3939

4040
const (
41-
extensionDir = "python/"
42-
testDataPath = extensionDir + "testdata/"
41+
extensionDir = "python" + string(os.PathSeparator)
42+
testDataPath = extensionDir + "testdata" + string(os.PathSeparator)
4343
gazelleBinaryName = "gazelle_binary"
4444
)
4545

0 commit comments

Comments
 (0)
0