Skip to content

Better sorting & sorting out circular deps #290

Description

@talsuk5

First let me start with a big thanks to @DavidVujic for maintaining this awesome library.
My team uses it and we love it. so much that it has become part of our CI and I even made a zsh plugin so it easier to poetry poly around lol (@DavidVujic ping me in private if you want to distribute it somehow, I don't mind sharing).

I have 2 features I would like to discuss:

Is your feature request related to a problem? Please describe.

  1. when using ppc (poetry poly check) -v, each time the order of packages and the order that comes after "is importing" is changed. also for some reason there's a line break if the list exceeds some length, causing tools like grep to be harder to apply.

  2. let's say I have 2 bricks, aa and bb. aa defines classes A and B and bb defines class C such that

# a.py
class A:
    pass

# b.py
from proj.bb.core import C

class B(C):
    pass

# c.py
from proj.aa.core import A

class C(A):
    pass

which is perfectly python legal but results in :
image
Screenshot 2024-11-16 at 22 06 26

which can lead to bad packages includes in the pyproject.toml file.

Describe the solution you'd like

  1. sort the packages and the part after "is importing" (lexicographically I assume?) and don't introduce line breaks
  2. make it so poetry poly check or another command if necessary will result in something like
🤔 Circular dependency detected between aa and bb 
Error: Process completed with exit code 1.

Describe alternatives you've considered
There's no alternative to polylith. it's really good.

Additional context
Keep up the good work David 👏

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions