-
Notifications
You must be signed in to change notification settings - Fork 540
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
Issues with AWS CDK >= 2.51.0 #914
Comments
You can fix that particular error you posted by doing this: diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel
index b3c4386..4a986e1 100644
--- a/WORKSPACE.bazel
+++ b/WORKSPACE.bazel
@@ -43,6 +43,7 @@ pip_parse(
name = "pip",
requirements_lock = "//py:requirements.txt.lock",
python_interpreter_target = py_interpreter,
+ enable_implicit_namespace_pkgs = True,
)
load("@pip//:requirements.bzl", lazy_pip_install = "install_deps") That, together with Unfortunately, you then run into this error:
Digging into it, it seems to be happening because the
I.e. it never finds the following file(s) because Python stopped looking for namespace packages named
That means |
Thanks for looking into it. Yes, I can verify that behavior and have updated the reproduction case. I also have an issue open in the CDK aws/jsii#3881, so I will post this over there as well to see if there is something they can fix on their end. |
I got some feedback on the Bazel slack and was able to push a fix up to the |
@philsc I reposted you comment over on the bug in the CDK and they are asking for a bit of clarification on why you think their library doesn't support namespace packages? Could you elaborate on this a bit so I can get direct them on what might need to change in their library to make this work without too much workaround? |
I replied there directly 👍 |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
Commenting since the issue got marked stale. This is still blocking me upgrading this AWS dependency, however, it sounds like this is a bug on their side and a fix on rules_python's side would introduce non-standard compliant behavior that may lead to other issues. |
With #1393 you should be able to apply patches to wheels, although it only supports |
FYI, for legacy The source code documenting on what you would need to pass is https://github.com/bazelbuild/rules_python/blob/main/python/pip_install/pip_repository.bzl#L847. |
@aignas A wheel patch won't fix this because the |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?" |
🐞 bug report
Affected Rule
requirement
pip_parse
Is this a regression?
No
Description
With AWS CDK 2.51.0, they have split out a number of sub-packages. Not sure why as they are required dependencies, but nonetheless, if you depend on
aws-cdk-lib
, you also now depend on:This seems to break tests in my monorepo. I am not sure exactly why, but my theory is that there are now multiple
aws-cdk/__init__.py
's in my PYTHONPATH due torules_python
's PYTHONPATH-based solution for handling pip dependencies.🔬 Minimal Reproduction
I have made a minimal example here: https://github.com/psalvaggio-dl/bazel-cdk-repro
In order to reproduce, the
bazel test //py:test
can be run.🔥 Exception or Error
My
pytest
test prints out the following error:Aws we can see in the error, it seems to thing that the
aws_cdk/__init__.py
inpip_aws_cdk_asset_awscli_v1
is the right one, which is why I feel like having multiples in the PYTHONPATH is the issue.🌍 Your Environment
Operating System:
Ubuntu 22.04
Output of
bazel version
:Rules_python version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: