File tree Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -299,24 +299,28 @@ pkg_tar(
299299 }),
300300)
301301
302+ sh_binary (
303+ name = "setup_wrapper" ,
304+ srcs = ["setup_wrapper.sh" ],
305+ data = [requirement ("setuptools" )],
306+ visibility = ["//visibility:private" ],
307+ )
308+
302309genrule (
303310 name = "source_wheel" ,
304311 srcs = [":source_tarball" ],
305312 outs = ["protobuf-%s.tar.gz" % PROTOBUF_PYTHON_VERSION ],
306313 cmd = """
307- export PYTHONPATH=$$PWD/external/protobuf_pip_deps_setuptools/site-packages
308314 set -eux
309315 tar -xzvf $(location :source_tarball)
310- cd protobuf/
311- python3 setup.py sdist
312- cd ..
316+ $(location :setup_wrapper) sdist
313317 mv protobuf/dist/*.tar.gz $@
314318 """ ,
315319 target_compatible_with = select ({
316320 "@system_python//:none" : ["@platforms//:incompatible" ],
317321 "//conditions:default" : [],
318322 }),
319- tools = [requirement ( "setuptools" ) ],
323+ tools = [":setup_wrapper" ],
320324)
321325
322326py_wheel (
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -eux
3+
4+ # Find the setuptools directory and add it to PYTHONPATH
5+ SETUPTOOLS_PATH=$( find $PWD -name " setuptools" -type d | grep site-packages | head -1)
6+ if [ -z " $SETUPTOOLS_PATH " ]; then
7+ echo " Warning: Could not find setuptools directory"
8+ else
9+ SITE_PACKAGES_DIR=$( dirname " $SETUPTOOLS_PATH " )
10+ echo " Using setuptools from: $SITE_PACKAGES_DIR "
11+ export PYTHONPATH=" $SITE_PACKAGES_DIR "
12+ fi
13+
14+ # Run setup.py with the arguments passed to this script
15+ cd protobuf/
16+ python3 setup.py " $@ "
Original file line number Diff line number Diff line change 11numpy <= 2.1.0
2- setuptools <= 70.3.0
2+ setuptools <= 78.1.1
33absl-py == 2.*
You can’t perform that action at this time.
0 commit comments