Skip to content

Build fails when monorepo dependencies share an updated managed dependency #384

@epwilkins

Description

@epwilkins

Steps to Reproduce

  1. Create a project with two Habushu Poetry modules, where one depends on the other
  2. Add the same external dependency to both modules
  3. Add the external dependency to Habushu's managedDependencies list in the root POM
  4. Build the project (mvn clean install)
  5. Update the version of the external dependency in the root POM
  6. Manually update the pyproject.toml of the module that's the consumer of the other module (e.g., add jsonpickle = ">=2.1.0" to the pyproject.toml)
  7. Build the project

Expected Result

The project updates each module's pyproject.toml as it is built and builds successfully

Actual result

The first module builds just fine and has the version updated, but when the second module is built the build fails. Habushu tries to run poetry lock during the initialize-habushu phase but without taking into account the managedDependencies updates, and so Poetry fails to update due to a version solving error:

14:01:47 [INFO] --- habushu:2.18.1:initialize-habushu (default-initialize-habushu) @ consuming-module ---
14:01:47 [INFO] Validating Poetry-based project structure...
14:01:47 [INFO] Executing Poetry command: poetry check
14:01:47 [ERROR] Error: pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock` to fix the lock file.
14:01:47 [WARNING] poetry check failed (debug contains more details) - this is likely due to a mismatch between your pyproject.toml and poetry.lock file - attempting to correct...
14:01:48 [INFO] Executing Poetry command: poetry lock
14:01:49 [ERROR] Resolving dependencies...
14:01:49 [ERROR]
Because consuming-module depends on library-module (1.0.0.dev) @ file:///path/to/library-module which depends on external-dependency (1.1.0), external-dependency is required.
So, because consuming-module depends on external-dependency (1.0.0), version solving failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions