8000 Remove unused code (#933) · bazel-contrib/rules_python@222ec4b · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 222ec4b

Browse files
authored
Remove unused code (#933)
1 parent 4528038 commit 222ec4b

File tree

3 files changed

+0
-87
lines changed

3 files changed

+0
-87
lines changed

python/pip_install/extract_wheels/BUILD

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,6 @@ py_test(
148148
],
149149
)
150150

151-
py_test(
152-
name = "requirements_bzl_test",
153-
size = "small",
154-
srcs = [
155-
"requirements_bzl_test.py",
156-
],
157-
deps = [
158-
":lib",
159-
],
160-
)
161-
162151
filegroup(
163152
name = "distribution",
164153
srcs = glob(

python/pip_install/extract_wheels/bazel.py

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -201,63 +201,6 @@ def generate_build_file_contents(
201201
)
202202

203203

204-
def generate_requirements_file_contents(repo_name: str, targets: Iterable[str]) -> str:
205-
"""Generate a requirements.bzl file for a given pip repository
206-
207-
The file allows converting the PyPI name to a bazel label. Additionally, it adds a function which can glob all the
208-
installed dependencies.
209-
210-
Args:
211-
repo_name: the name of the pip repository
212-
targets: a list of Bazel labels pointing to all the generated targets
213-
214-
Returns:
215-
A complete requirements.bzl file as a string
216-
"""
217-
218-
sorted_targets = sorted(targets)
219-
requirement_labels = ",".join(sorted_targets)
220-
whl_requirement_labels = ",".join(
221-
'"{}:whl"'.format(target.strip('"')) for target in sorted_targets
222-
)
223-
return textwrap.dedent(
224-
"""\
225-
all_requirements = [{requirement_labels}]
226-
227-
all_whl_requirements = [{whl_requirement_labels}]
228-
229-
def requirement(name):
230-
name_key = name.replace("-", "_").replace(".", "_").lower()
231-
return "{repo}//pypi__" + name_key
232-
233-
def whl_requirement(name):
234-
return requirement(name) + ":{whl_file_label}"
235-
236-
def data_requirement(name):
237-
return requirement(name) + ":{data_label}"
238-
239-
def dist_info_requirement(name):
240-
return requirement(name) + ":{dist_info_label}"
241-
242-
def entry_point(pkg, script = None):
243-
if not script:
244-
script = pkg
245-
return requirement(pkg) + ":{entry_point_prefix}_" + script
246-
247-
def install_deps():
248-
fail("install_deps() only works if you are creating an incremental repo. Did you mean to use pip_parse()?")
249-
""".format(
250-
repo=repo_name,
251-
requirement_labels=requirement_labels,
252-
whl_requirement_labels=whl_requirement_labels,
253-
whl_file_label=WHEEL_FILE_LABEL,
254-
data_label=DATA_LABEL,
255-
dist_info_label=DIST_INFO_LABEL,
256-
entry_point_prefix=WHEEL_ENTRY_POINT_PREFIX,
257-
)
258-
)
259-
260-
261204
def sanitise_name(name: str, prefix: str) -> str:
262205
"""Sanitises the name to be compatible with Bazel labels.
263206

python/pip_install/extract_wheels/requirements_bzl_test.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0