fix(release): minimum needed to run twine to publish (#1021)

* fix(release): minimum needed to run twine to publish

Earlier attempts to publish 0.17 have failed mysteriously at the pypa/gh-action-pypi-publish step.
This PR replaces that with a command that I can test locally.

TWINE_USERNAME=__token__ TWINE_PASSWORD=pypi-*** bazel run --stamp --embed_label=1.2.4 //python/runfiles:wheel.publish -- --repository testpypi
Uploading bazel_runfiles-1.2.4-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.0/11.0 kB • 00:00 • 27.3 MB/s

View at:
https://test.pypi.org/project/bazel-runfiles/1.2.4/

* fixup! fix(release): minimum needed to run twine to publish

* refactor: move twine deps to its own folder

* Update WORKSPACE

Co-authored-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>

* Update python/runfiles/BUILD.bazel

Co-authored-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>

* show CI failure

* remove actual publish for this PR

* chore: exclude requirements test on RBE

* Add darwin requirements

---------

Co-authored-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
diff --git a/WORKSPACE b/WORKSPACE
index b7059b6..a833de8 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -67,3 +67,22 @@
 # This rule loads and compiles various go dependencies that running gazelle
 # for python requirements.
 _py_gazelle_deps()
+
+#####################
+# Install twine for our own runfiles wheel publishing.
+# Eventually we might want to install twine automatically for users too, see:
+# https://github.com/bazelbuild/rules_python/issues/1016.
+load("@python//3.11.1:defs.bzl", "interpreter")
+load("@rules_python//python:pip.bzl", "pip_parse")
+
+pip_parse(
+    name = "publish_deps",
+    python_interpreter_target = interpreter,
+    requirements_darwin = "//tools/publish:requirements_darwin.txt",
+    requirements_lock = "//tools/publish:requirements.txt",
+    requirements_windows = "//tools/publish:requirements_windows.txt",
+)
+
+load("@publish_deps//:requirements.bzl", "install_deps")
+
+install_deps()