Skip to content

Commit 7b88c87

Browse files
aignasrickeylev
andauthored
refactor(pypi): split out a hub_builder helper from the extension code (#3243)
This is a somewhat tedious refactor, where I am just moving code around (and sometimes renaming various parameters). I am not modifying and/or fixing any bugs other than more error messages in one place since I noticed there was a lack of validation. The main idea is to create a `hub_builder` so that we could also use it for `pip.configure` calls and/or use it for `py.lock` file parsing and reuse code. I hope that moving it to a separate file makes it a little bit more obvious what pieces are used to create a hub repository. What is more, since the pip extension is reproducible, I have removed some code that was sorting the output. Work towards #2747 --------- Co-authored-by: Richard Levasseur <[email protected]>
1 parent b8e32c4 commit 7b88c87

File tree

3 files changed

+650
-536
lines changed

3 files changed

+650
-536
lines changed

python/private/pypi/BUILD.bazel

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,17 @@ bzl_library(
109109
name = "extension_bzl",
110110
srcs = ["extension.bzl"],
111111
deps = [
112-
":attrs_bzl",
113112
":evaluate_markers_bzl",
113+
":hub_builder_bzl",
114114
":hub_repository_bzl",
115-
":parse_requirements_bzl",
116115
":parse_whl_name_bzl",
117116
":pep508_env_bzl",
118117
":pip_repository_attrs_bzl",
119-
":python_tag_bzl",
120118
":simpleapi_download_bzl",
121-
":whl_config_setting_bzl",
122119
":whl_library_bzl",
123-
":whl_repo_name_bzl",
124-
"//python/private:full_version_bzl",
120+
"//python/private:auth_bzl",
125121
"//python/private:normalize_name_bzl",
126-
"//python/private:version_bzl",
127-
"//python/private:version_label_bzl",
122+
"//python/private:repo_utils_bzl",
128123
"@bazel_features//:features",
129124
"@pythons_hub//:interpreters_bzl",
130125
"@pythons_hub//:versions_bzl",
@@ -167,6 +162,27 @@ bzl_library(
167162
],
168163
)
169164

165+
bzl_library(
166+
name = "hub_builder_bzl",
167+
srcs = ["hub_builder.bzl"],
168+
visibility = ["//:__subpackages__"],
169+
deps = [
170+
":attrs_bzl",
171+
":evaluate_markers_bzl",
172+
":parse_requirements_bzl",
173+
":pep508_env_bzl",
174+
":pep508_evaluate_bzl",
175+
":python_tag_bzl",
176+
":requirements_files_by_platform_bzl",
177+
":whl_config_setting_bzl",
178+
":whl_repo_name_bzl",
179+
"//python/private:full_version_bzl",
180+
"//python/private:normalize_name_bzl",
181+
"//python/private:version_bzl",
182+
"//python/private:version_label_bzl",
183+
],
184+
)
185+
170186
bzl_library(
171187
name = "hub_repository_bzl",
172188
srcs = ["hub_repository.bzl"],

0 commit comments

Comments
 (0)