Skip to content

Commit fa0d7b2

Browse files
committed
Remove some vestigial convenience code.
Elaborate on why the TODO to rewrite {pip,whl}.sh as Python is harder than it looks.
1 parent 13c47f3 commit fa0d7b2

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

python/pip.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# TODO(mattmoor): Rewrite this in Python.
17+
# TODO(mattmoor): Ideally we'd rewrite this in Python for portability, but
18+
# since the executes during WORKSPACE instantiation that would require
19+
# redistributing PAR files, since we cannot invoke built tools at that time.
1820
NAME="$1"
1921
REQUIREMENTS_TXT="$2"
2022
REQUIREMENTS_BZL="$3"
@@ -69,7 +71,7 @@ done)
6971
_packages = {
7072
$(for p in ${PACKAGES}; do
7173
whl="$(basename ${p})"
72-
echo "\"$(package_name ${whl})\": \"@$(repository_name ${whl})//lib\","
74+
echo "\"$(package_name ${whl})\": \"@$(repository_name ${whl})//:pkg\","
7375
done)
7476
}
7577

python/whl.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
# limitations under the License.
1616

1717

18-
# TODO(mattmoor): Rewrite this in Python.
18+
# TODO(mattmoor): Ideally we'd rewrite this in Python for portability, but
19+
# since the executes during WORKSPACE instantiation that would require
20+
# redistributing PAR files, since we cannot invoke built tools at that time.
1921
WHL="$1"
2022
REQUIREMENTS="$2"
2123
PKG=$(basename "${WHL}" | cut -d'-' -f 1)
@@ -72,21 +74,9 @@ py_library(
7274
deps = [$(
7375
DELIM=
7476
for d in ${DEPS[@]}; do
75-
# Use the dictionary?
7677
echo -n "${DELIM}packages(\"${d}\")"
7778
DELIM=,
7879
done
7980
)],
8081
)
8182
EOF
82-
83-
# A convenience for terseness.
84-
mkdir lib
85-
cat > "lib/BUILD" <<EOF
86-
package(default_visibility = ["//visibility:public"])
87-
88-
py_library(
89-
name = "lib",
90-
deps = ["//:pkg"],
91-
)
92-
EOF

0 commit comments

Comments
 (0)