ripe-helmet-63854
10/11/2023, 12:07 AMhappy-kitchen-89482
10/11/2023, 12:32 AMhappy-kitchen-89482
10/11/2023, 12:32 AMripe-helmet-63854
10/11/2023, 12:40 AMhappy-kitchen-89482
10/11/2023, 12:47 AMhappy-kitchen-89482
10/11/2023, 12:48 AMhappy-kitchen-89482
10/11/2023, 12:50 AM!!
to exclude a dep. See https://www.pantsbuild.org/v2.18/docs/targets (scroll down to "Ignore dependencies with ! and !!")happy-kitchen-89482
10/11/2023, 12:51 AM!!
to exclude numpy and pandas from your function, assuming you have some other way of building the underlying layerripe-helmet-63854
10/11/2023, 1:11 AMpython_aws_lambda_function(
name="x",
output_path='api/x.zip',
handler="handlers.py:*",
dependencies=['api/x/y.py', '!!3rdparty/python:numpy', '!!3rdparty/python:pandas'],
complete_platforms=["api/lambda_config:aws_lambda_python_3_10"]
)
But I get this error:
InvalidFieldException: api/analytics/BUILD:3: Failed to get dependencies for api/analytics:x: The file or directory '3rdparty/python' does not exist on disk in the workspace, so the address '3rdparty/python:pandas' from the `dependencies` field from the target api/analytics:x cannot be resolved.
ripe-helmet-63854
10/11/2023, 1:12 AMripe-helmet-63854
10/11/2023, 1:19 AMripe-helmet-63854
10/11/2023, 1:19 AMhappy-kitchen-89482
10/11/2023, 1:29 AMhappy-kitchen-89482
10/11/2023, 1:31 AM!!
syntax is intended to exclude a dep transitively, but that doesn't work through third-party deps, to which Pants is currently blind. So for example if you happened to depend on some third-party distribution foo that happened to depend on pandas
, it would get pulled in that way regardlesshappy-kitchen-89482
10/11/2023, 1:31 AMhappy-kitchen-89482
10/11/2023, 1:31 AM!!3rdparty/python#numpy
etc?