Skip to content

test: Add _test_simple_multiple_platforms_with_extras #3193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hartikainen
Copy link

As requested in #2797 (comment) and aignas#2 (comment). Related to #2797.

Failure output:
$ bazel test //tests/pypi/extension:test_simple_multiple_platforms_with_extras
ERROR: /Users/user/bazel-contrib/rules_python/main/tests/pypi/extension/BUILD.bazel:17:21: in test_simple_multiple_platforms_with_extras_test rule //tests/pypi/extension:test_simple_multiple_platforms_with_extras:
Traceback (most recent call last):
        File "/private/var/tmp/_bazel_user/07a78f2e19ea2b267dc879919d0b00c5/external/rules_testing+/lib/private/analysis_test.bzl", line 309, column 13, in wrapped_impl
                impl(env, target)
        File "/private/var/tmp/_bazel_user/07a78f2e19ea2b267dc879919d0b00c5/external/rules_testing+/lib/unit_test.bzl", line 43, column 40, in lambda
                impl = lambda env, target: impl(env),
        File "/Users/user/bazel-contrib/rules_python/main/tests/pypi/extension/extension_tests.bzl", line 411, column 26, in _test_simple_multiple_platforms_with_extras
                pypi = _parse_modules(
        File "/Users/user/bazel-contrib/rules_python/main/tests/pypi/extension/extension_tests.bzl", line 83, column 22, in _parse_modules
                parse_modules(
        File "/Users/user/bazel-contrib/rules_python/main/python/private/pypi/extension.bzl", line 699, column 36, in parse_modules
                out = _create_whl_repos(
        File "/Users/user/bazel-contrib/rules_python/main/python/private/pypi/extension.bzl", line 343, column 21, in _create_whl_repos
                fail("attempting to create a duplicate library {} for {}".format(
Error in fail: attempting to create a duplicate library pypi_312_package_py3_none_any_62833036 for package
ERROR: /Users/user/bazel-contrib/rules_python/main/tests/pypi/extension/BUILD.bazel:17:21: Analysis of target '//tests/pypi/extension:test_simple_multiple_platforms_with_extras' failed
ERROR: Analysis of target '//tests/pypi/extension:test_simple_multiple_platforms_with_extras' failed; build aborted
INFO: Elapsed time: 0.063s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested

Run with:
```console
bazel test //tests/pypi/extension:test_simple_multiple_platforms_with_extras
```
Comment on lines +478 to +481
# NOTE(hartikainen): Perhaps this is part of the problem?
# This should say `package[extra]==0.7.0` for `linux_x86_64` platform and
# `package==0.7.0` for `linux_arm64`
"requirement": "package[extra]==0.7.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hah, actually this is a separate issue and I am not sure how we can fix it. So, a little bit of history here:

  1. poetry will export a requirements.txt that will have both package[extra] and package and we were asked to only consider package[extra] when doing the installation.
  2. However with the advent of universal files it means that we should do something differently - first resolve the compatible lines with the target platforms and do the filtering differently.

I remember we had this discussion with in one of @ewianda PRs, but I can't remember which one it is.

I think the issue that you are facing does not have an open issue yet.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What is more, we have a test that already tests for this behaviour in the case where the extras differ, but we don't have a test where extra is present in one and in another it is not.

PRs for this are welcome and we should have enough test coverage in places that the fix would be touching.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the quick response and context! I'll look into the existing case where extras differ to see if that can be extended to this case. Let's see where I get.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants