Skip to content
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

Use ruff-python-parser to compute Python imports #3103

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
326 changes: 309 additions & 17 deletions deps/rust/Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions deps/rust/cargo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ PACKAGES = {
"pico-args": crate.spec(version = "0"),
"proc-macro2": crate.spec(version = "1"),
"quote": crate.spec(version = "1"),
"ruff_python_ast": crate.spec(git = "https://github.com/astral-sh/ruff.git", tag = "0.7.0"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any idea why the don't publish on crates.io ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is that they have a big monorepo and don't really care about supporting downstream users of the crates only of the CLI tools they are used to define.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will need downstream changes to add these crates too.

"ruff_python_parser": crate.spec(git = "https://github.com/astral-sh/ruff.git", tag = "0.7.0"),
hoodmane marked this conversation as resolved.
Show resolved Hide resolved
"serde_json": crate.spec(version = "1"),
"serde": crate.spec(version = "1", features = ["derive"]),
"syn": crate.spec(version = "2"),
Expand Down
44 changes: 44 additions & 0 deletions deps/rust/crates/BUILD.Inflector-0.11.4.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
###############################################################################
# @generated
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @//deps/rust:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

rust_library(
name = "inflector",
srcs = glob(
include = ["**/*.rs"],
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_root = "src/lib.rs",
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=Inflector",
"manual",
"noclippy",
"norustfmt",
],
version = "0.11.4",
)
52 changes: 52 additions & 0 deletions deps/rust/crates/BUILD.aho-corasick-1.1.3.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
###############################################################################
# @generated
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @//deps/rust:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

rust_library(
name = "aho_corasick",
srcs = glob(
include = ["**/*.rs"],
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_features = [
"default",
"perf-literal",
"std",
],
crate_root = "src/lib.rs",
edition = "2021",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=aho-corasick",
"manual",
"noclippy",
"norustfmt",
],
version = "1.1.3",
deps = [
"@crates_vendor__memchr-2.7.4//:memchr",
],
)
20 changes: 19 additions & 1 deletion deps/rust/crates/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ alias(
tags = ["manual"],
)

alias(
name = "ruff_python_ast",
actual = "@crates_vendor__ruff_python_ast-0.0.0//:ruff_python_ast",
tags = ["manual"],
)

alias(
name = "ruff_python_parser",
actual = "@crates_vendor__ruff_python_parser-0.0.0//:ruff_python_parser",
tags = ["manual"],
)

alias(
name = "serde",
actual = "@crates_vendor__serde-1.0.214//:serde",
Expand Down Expand Up @@ -171,7 +183,13 @@ alias(
)

alias(
name = "phf_generator__gen_hash_test",
name = "phf_generator-0.8.0__gen_hash_test",
actual = "@crates_vendor__phf_generator-0.8.0//:gen_hash_test__bin",
tags = ["manual"],
)

alias(
name = "phf_generator-0.11.2__gen_hash_test",
actual = "@crates_vendor__phf_generator-0.11.2//:gen_hash_test__bin",
tags = ["manual"],
)
54 changes: 54 additions & 0 deletions deps/rust/crates/BUILD.bstr-1.10.0.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
###############################################################################
# @generated
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @//deps/rust:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

rust_library(
name = "bstr",
srcs = glob(
include = ["**/*.rs"],
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_features = [
"alloc",
"default",
"std",
"unicode",
],
crate_root = "src/lib.rs",
edition = "2021",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=bstr",
"manual",
"noclippy",
"norustfmt",
],
version = "1.10.0",
deps = [
"@crates_vendor__memchr-2.7.4//:memchr",
"@crates_vendor__regex-automata-0.4.8//:regex_automata",
],
)
50 changes: 50 additions & 0 deletions deps/rust/crates/BUILD.castaway-0.2.3.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
###############################################################################
# @generated
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @//deps/rust:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

rust_library(
name = "castaway",
srcs = glob(
include = ["**/*.rs"],
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_features = [
"alloc",
],
crate_root = "src/lib.rs",
edition = "2018",
proc_macro_deps = [
"@crates_vendor__rustversion-1.0.18//:rustversion",
],
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=castaway",
"manual",
"noclippy",
"norustfmt",
],
version = "0.2.3",
)
58 changes: 58 additions & 0 deletions deps/rust/crates/BUILD.compact_str-0.8.0.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
###############################################################################
# @generated
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @//deps/rust:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

rust_library(
name = "compact_str",
srcs = glob(
include = ["**/*.rs"],
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_features = [
"default",
"std",
],
crate_root = "src/lib.rs",
edition = "2021",
proc_macro_deps = [
"@crates_vendor__rustversion-1.0.18//:rustversion",
],
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=compact_str",
"manual",
"noclippy",
"norustfmt",
],
version = "0.8.0",
deps = [
"@crates_vendor__castaway-0.2.3//:castaway",
"@crates_vendor__cfg-if-1.0.0//:cfg_if",
"@crates_vendor__itoa-1.0.11//:itoa",
"@crates_vendor__ryu-1.0.18//:ryu",
"@crates_vendor__static_assertions-1.1.0//:static_assertions",
],
)
47 changes: 47 additions & 0 deletions deps/rust/crates/BUILD.either-1.13.0.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
###############################################################################
# @generated
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @//deps/rust:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

rust_library(
name = "either",
srcs = glob(
include = ["**/*.rs"],
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_features = [
"use_std",
],
crate_root = "src/lib.rs",
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=either",
"manual",
"noclippy",
"norustfmt",
],
version = "1.13.0",
)
Loading
Loading