Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Removed python test dependencies from public API #1905

Merged
merged 1 commit into from
Jul 2, 2021
Merged

Removed python test dependencies from public API #1905

merged 1 commit into from
Jul 2, 2021

Conversation

UebelAndre
Copy link
Contributor

@UebelAndre UebelAndre commented Jul 2, 2021

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

The python dependencies appear to be only used by test targets. If this is the case, users should not be forced to define them. The test target should be moved to another package so the dependencies can generally be ignored.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@google-cla
Copy link

google-cla bot commented Jul 2, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@UebelAndre
Copy link
Contributor Author

It's not clear to me why the tests are failing but it appears to be affecting other PRs as well

failure:

INFO: Repository io_bazel_rules_docker_pip_deps instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule pip_repository defined at:
  /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/rules_python/python/pip_install/pip_repository.bzl:67:33: in <toplevel>
ERROR: An error occurred during the fetch of repository 'io_bazel_rules_docker_pip_deps':
   rules_python_external failed: Collecting six==1.11.0
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
  Saved ./six-1.11.0-py2.py3-none-any.whl
Collecting addict==2.1.2
  Downloading https://files.pythonhosted.org/packages/62/55/bbfdbdd6c44c78a0715d5569d579497cd41efa75b6ac84d6939c67e6f870/addict-2.1.2.tar.gz
 (ERROR: Could not find a version that satisfies the requirement PyYAML==5.4 (from -r /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/io_bazel_rules_docker/repositories/requirements-pip.txt (line 5)) (from versions: 3.10, 3.11, 3.12, 3.13b1, 3.13rc1, 3.13, 4.2b1, 4.2b2, 4.2b4, 5.1b1, 5.1b3, 5.1b5, 5.1, 5.1.1, 5.1.2, 5.2b1, 5.2, 5.3b1, 5.3, 5.3.1)
ERROR: No matching distribution found for PyYAML==5.4 (from -r /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/io_bazel_rules_docker/repositories/requirements-pip.txt (line 5))
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/rules_python/python/pip_install/extract_wheels/__main__.py", line 5, in <module>
    main()
  File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/rules_python/python/pip_install/extract_wheels/__init__.py", line 87, in main
    subprocess.run(pip_args, check=True)
  File "/usr/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'wheel', '-r', '/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/io_bazel_rules_docker/repositories/requirements-pip.txt']' returned non-zero exit status 1
)
ERROR: Skipping '//testdata:derivative_with_volume.tar': no such package '@io_bazel_rules_docker_pip_deps//': rules_python_external failed: Collecting six==1.11.0
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
  Saved ./six-1.11.0-py2.py3-none-any.whl
Collecting addict==2.1.2
  Downloading https://files.pythonhosted.org/packages/62/55/bbfdbdd6c44c78a0715d5569d579497cd41efa75b6ac84d6939c67e6f870/addict-2.1.2.tar.gz
 (ERROR: Could not find a version that satisfies the requirement PyYAML==5.4 (from -r /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/io_bazel_rules_docker/repositories/requirements-pip.txt (line 5)) (from versions: 3.10, 3.11, 3.12, 3.13b1, 3.13rc1, 3.13, 4.2b1, 4.2b2, 4.2b4, 5.1b1, 5.1b3, 5.1b5, 5.1, 5.1.1, 5.1.2, 5.2b1, 5.2, 5.3b1, 5.3, 5.3.1)
ERROR: No matching distribution found for PyYAML==5.4 (from -r /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/io_bazel_rules_docker/repositories/requirements-pip.txt (line 5))
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/rules_python/python/pip_install/extract_wheels/__main__.py", line 5, in <module>
    main()
  File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/rules_python/python/pip_install/extract_wheels/__init__.py", line 87, in main
    subprocess.run(pip_args, check=True)
  File "/usr/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'wheel', '-r', '/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/io_bazel_rules_docker/repositories/requirements-pip.txt']' returned non-zero exit status 1
)
ERROR: no such package '@io_bazel_rules_docker_pip_deps//': rules_python_external failed: Collecting six==1.11.0
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
  Saved ./six-1.11.0-py2.py3-none-any.whl
Collecting addict==2.1.2
  Downloading https://files.pythonhosted.org/packages/62/55/bbfdbdd6c44c78a0715d5569d579497cd41efa75b6ac84d6939c67e6f870/addict-2.1.2.tar.gz
 (ERROR: Could not find a version that satisfies the requirement PyYAML==5.4 (from -r /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/io_bazel_rules_docker/repositories/requirements-pip.txt (line 5)) (from versions: 3.10, 3.11, 3.12, 3.13b1, 3.13rc1, 3.13, 4.2b1, 4.2b2, 4.2b4, 5.1b1, 5.1b3, 5.1b5, 5.1, 5.1.1, 5.1.2, 5.2b1, 5.2, 5.3b1, 5.3, 5.3.1)
ERROR: No matching distribution found for PyYAML==5.4 (from -r /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/io_bazel_rules_docker/repositories/requirements-pip.txt (line 5))
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/rules_python/python/pip_install/extract_wheels/__main__.py", line 5, in <module>
    main()
  File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/rules_python/python/pip_install/extract_wheels/__init__.py", line 87, in main
    subprocess.run(pip_args, check=True)
  File "/usr/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'wheel', '-r', '/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1808/execroot/io_bazel_rules_docker/bazel-out/k8-fastbuild/bin/tests/contrib/bazel_out1/external/io_bazel_rules_docker/repositories/requirements-pip.txt']' returned non-zero exit status 1
)

@UebelAndre UebelAndre marked this pull request as ready for review July 2, 2021 04:55
Copy link
Collaborator

@gravypod gravypod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me. I think this can go in.

@gravypod gravypod self-requested a review July 2, 2021 20:48
Copy link
Collaborator

@gravypod gravypod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind making sure build_tar.py still works when rules_python isn't included? There should be a test for this but I don't know if it was added into CI.

This is just me being overly cautious probably.

@gravypod gravypod merged commit b886744 into bazelbuild:master Jul 2, 2021
@UebelAndre UebelAndre deleted the python branch July 2, 2021 21:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants