Skip to content

Consider removing the importlib-metadata version 1.x restriction. #350

@leandrodamascena

Description

@leandrodamascena

Hello everyone! I'm currently integrating Datadog as an external provider for observability in Powertools for AWS Lambda (Python) - aws-powertools/powertools-lambda-python#2194. However, I've encountered issues adding datadog-lambda as a dependency because it's locked to importlib-metadata ^1.x, causing some of our other dependencies to fail.

Expected Behavior

Being able to add datadog-lambda as an external dependency and not have dependency resolution issues.

Actual Behavior

Cannot add because datadog-lambda lock importlib-metadata in ^1.x.

Steps to Reproduce the Problem

  1. Clone https://github.com/aws-powertools/powertools-lambda-python
  2. Type poetry add datadog_lambda

Possible Solution

I was looking at the code and it looks like it's not a problem to remove the lock for ^1.x and add any importlib-metadata version, so poetry/pip can resolve the dependencies. I even cloned this repository, updated the version and the tests are green.

image

Specifications

  • Datadog Lambda Layer version: Doesn't apply
  • Python version: 3.7

Stacktrace

❯ poetry add datadog_lambda      
Using version ^4.75.0 for datadog-lambda

Updating dependencies
Resolving dependencies... (0.6s)

    Because no versions of mkdocs match >1.4.2,<1.4.3 || >1.4.3
 and mkdocs (1.4.2) depends on importlib-metadata (>=4.3), mkdocs (>=1.4.2,<1.4.3 || >1.4.3) requires importlib-metadata (>=4.3).
    And because mkdocs (1.4.3) depends on importlib-metadata (>=4.3), mkdocs (>=1.4.2) requires importlib-metadata (>=4.3).
    Because no versions of datadog-lambda match >4.75.0,<5.0.0
 and datadog-lambda (4.75.0) depends on importlib_metadata (>=1.0,<2.0), datadog-lambda (>=4.75.0,<5.0.0) requires importlib_metadata (>=1.0,<2.0).
(1) Thus, datadog-lambda (>=4.75.0,<5.0.0) is incompatible with mkdocs (>=1.4.2).

    Because no versions of mkdocs-material match >9.1.19,<9.2.0b0 || >9.2.0b0,<9.2.0b1 || >9.2.0b1,<10.0.0
 and mkdocs-material (9.2.0b0) depends on mkdocs (>=1.4.2), mkdocs-material (>9.1.19,<9.2.0b1 || >9.2.0b1,<10.0.0) requires mkdocs (>=1.4.2).
    And because mkdocs-material (9.2.0b1) depends on mkdocs (>=1.4.2)
 and mkdocs-material (9.1.19) depends on mkdocs (>=1.4.2), mkdocs-material (>=9.1.19,<10.0.0) requires mkdocs (>=1.4.2).
    And because datadog-lambda (>=4.75.0,<5.0.0) is incompatible with mkdocs (>=1.4.2) (1), datadog-lambda (>=4.75.0,<5.0.0) is incompatible with mkdocs-material (>=9.1.19,<10.0.0)
    So, because aws-lambda-powertools depends on both datadog-lambda (^4.75.0) and mkdocs-material (^9.1.19), version solving failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions