-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gazelle)!: Move the plugin to a separate workspace (#972)
feat!(gazelle): Move the plugin to a separate workspace Summary: * Move go.mod to gazelle. * Move gazelle definition. * Fix file distribution for the gazelle module. * Update the example test. * Include rules_python_gazelle_plugin during integration tests * Update ignored packages * Update CI configuration
- Loading branch information
Showing
31 changed files
with
208 additions
and
103 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
test --test_output=errors | ||
|
||
# Do NOT implicitly create empty __init__.py files in the runfiles tree. | ||
# By default, these are created in every directory containing Python source code | ||
# or shared libraries, and every parent directory of those directories, | ||
# excluding the repo root directory. With this flag set, we are responsible for | ||
# creating (possibly empty) __init__.py files and adding them to the srcs of | ||
# Python targets as required. | ||
build --incompatible_default_to_explicit_init_py | ||
|
||
# Windows makes use of runfiles for some rules | ||
build --enable_runfiles | ||
startup --windows_enable_symlinks |
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,12 @@ | ||
# Bazel directories | ||
/bazel-* | ||
/bazel-bin | ||
/bazel-genfiles | ||
/bazel-out | ||
/bazel-testlogs | ||
user.bazelrc | ||
|
||
# Go/Gazelle files | ||
# These otherwise match patterns above | ||
!go.mod | ||
!BUILD.out |
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 |
---|---|---|
@@ -1,22 +1,35 @@ | ||
alias( | ||
name = "gazelle", | ||
actual = "//gazelle/python", | ||
visibility = ["//visibility:public"], | ||
) | ||
load("@bazel_gazelle//:def.bzl", "gazelle") | ||
|
||
# Gazelle configuration options. | ||
# See https://github.com/bazelbuild/bazel-gazelle#running-gazelle-with-bazel | ||
# gazelle:prefix github.com/bazelbuild/rules_python/gazelle | ||
# gazelle:exclude bazel-out | ||
gazelle(name = "gazelle") | ||
|
||
alias( | ||
name = "gazelle_python_binary", | ||
actual = "//gazelle/python:gazelle_binary", | ||
visibility = ["//visibility:public"], | ||
gazelle( | ||
name = "gazelle_update_repos", | ||
args = [ | ||
"-from_file=go.mod", | ||
"-to_macro=deps.bzl%gazelle_deps", | ||
"-prune", | ||
], | ||
command = "update-repos", | ||
) | ||
|
||
filegroup( | ||
name = "distribution", | ||
srcs = glob(["**"]) + [ | ||
"//gazelle/manifest:distribution", | ||
"//gazelle/modules_mapping:distribution", | ||
"//gazelle/python:distribution", | ||
"//gazelle/pythonconfig:distribution", | ||
srcs = [ | ||
":BUILD.bazel", | ||
":README.md", | ||
":WORKSPACE", | ||
":def.bzl", | ||
":deps.bzl", | ||
":go.mod", | ||
":go.sum", | ||
"//manifest:distribution", | ||
"//modules_mapping:distribution", | ||
"//python:distribution", | ||
"//pythonconfig:distribution", | ||
], | ||
visibility = ["//:__pkg__"], | ||
visibility = ["@rules_python//:__pkg__"], | ||
) |
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,47 @@ | ||
workspace(name = "rules_python_gazelle_plugin") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "io_bazel_rules_go", | ||
sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", | ||
"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", | ||
], | ||
) | ||
|
||
http_archive( | ||
name = "bazel_gazelle", | ||
sha256 = "448e37e0dbf61d6fa8f00aaa12d191745e14f07c31cabfa731f0c8e8a4f41b97", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz", | ||
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz", | ||
], | ||
) | ||
|
||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") | ||
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") | ||
|
||
go_rules_dependencies() | ||
|
||
go_register_toolchains(version = "1.19.4") | ||
|
||
gazelle_dependencies() | ||
|
||
local_repository( | ||
name = "rules_python", | ||
path = "..", | ||
) | ||
|
||
load("@rules_python//python:repositories.bzl", "python_register_toolchains") | ||
|
||
python_register_toolchains( | ||
name = "python39", | ||
python_version = "3.9", | ||
) | ||
|
||
load("//:deps.bzl", _py_gazelle_deps = "gazelle_deps") | ||
|
||
# gazelle:repository_macro deps.bzl%gazelle_deps | ||
_py_gazelle_deps() |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/bazelbuild/rules_python | ||
module github.com/bazelbuild/rules_python/gazelle | ||
|
||
go 1.19 | ||
|
||
|
File renamed without changes.
Oops, something went wrong.