8000 Rename //rules_python package to //packaging (#228) · sgammon/rules_python@9d68f24 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d68f24

Browse files
authored
Rename //rules_python package to //packaging (bazel-contrib#228)
This avoids a name clash between the package name and the repo name, which prevented whl_test from running in the Bazel federation's CI. Regenerated the par files. Tested that this still works in environments where the system Python has a library named "packaging" installed, by creating a virtualenv, pip installing "packaging", and running `bazel test //examples/...`. Fixes bazel-contrib#227.
1 parent a48a8c8 commit 9d68f24

File tree

9 files changed

+8
-9
lines changed

9 files changed

+8
-9
lines changed

.bazelci/presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ all_targets: &all_targets
88
build_targets:
99
- "//examples/..."
1010
- "//experimental/..."
11+
- "//packaging/..."
1112
- "//python/..."
12-
- "//rules_python/..."
1313
- "//tools/..."
1414
test_targets:
1515
- "..."

rules_python/BUILD renamed to packaging/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
package(default_visibility = ["//visibility:public"])
1514

1615
licenses(["notice"]) # Apache 2.0
1716

rules_python/piptool.py renamed to packaging/piptool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def pip_main(argv):
8181
argv = ["--disable-pip-version-check", "--cert", cert_path] + argv
8282
return pip.main(argv)
8383

84-
from rules_python.whl import Wheel
84+
from packaging.whl import Wheel
8585

8686
parser = argparse.ArgumentParser(
8787
description='Import Python dependencies into Bazel.')
File renamed without changes.

rules_python/whl_test.py renamed to packaging/whl_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from mock import patch
1919

20-
from rules_python import whl
20+
from packaging import whl
2121

2222

2323
def TestData(name):

tools/piptool.par

-39 Bytes
Binary file not shown.

tools/update_tools/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ RUN bazel help info >/dev/null 2>&1
2525
CMD cp -r /opt/rules_python_source /opt/rules_python && \
2626
cd /opt/rules_python && \
2727
bazel clean && \
28-
bazel build //rules_python:piptool.par //rules_python:whltool.par \
28+
bazel build //packaging:piptool.par //packaging:whltool.par \
2929
# This works around a bug in git_repository to give us better debugging
3030
# if there's an error.
3131
# TODO(brandjon): Remove this once we're using Bazel 0.29, which
3232
# contains the fix.
3333
--incompatible_string_join_requires_strings=false && \
34-
cp bazel-bin/rules_python/piptool.par bazel-bin/rules_python/whltool.par /opt/rules_python_source/tools/ && \
34+
cp bazel-bin/packaging/piptool.par bazel-bin/packaging/whltool.par /opt/rules_python_source/tools/ && \
3535
chown --reference=/opt/rules_python_source/update_tools.sh /opt/rules_python_source/tools/piptool.par /opt/rules_python_source/tools/whltool.par

tools/whltool.par

-27 Bytes
Binary file not shown.

update_tools.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ if [ "$#" -eq 0 ] ; then
2525
docker build --no-cache -f tools/update_tools/Dockerfile --tag rules_python:update_tools .
2626
docker run -v"$PWD":/opt/rules_python_source rules_python:update_tools
2727
elif [ "$#" -eq 1 -a "$1" == "--nodocker" ] ; then
28-
bazel build //rules_python:piptool.par //rules_python:whltool.par
29-
cp bazel-bin/rules_python/piptool.par tools/piptool.par
30-
cp bazel-bin/rules_python/whltool.par tools/whltool.par
28+
bazel build //packaging:piptool.par //packaging:whltool.par
29+
cp bazel-bin/packaging/piptool.par tools/piptool.par
30+
cp bazel-bin/packaging/whltool.par tools/whltool.par
3131
else
3232
usage
3333
fi

0 commit comments

Comments
 (0)
0