botify-labs / simpleflow

Python library for dataflow programming.
https://botify-labs.github.com/simpleflow/
MIT License
68 stars 24 forks source link

Refactor imports #422

Closed jbbarth closed 11 months ago

jbbarth commented 1 year ago

See https://github.com/botify-labs/simpleflow/issues/420

The first PR is https://github.com/botify-labs/simpleflow/pull/421 and solves the issue (first commit).

This PR explores (two next commits) a more layered approach so our imports are ~guaranteed to not produce circular dependencies: imports are always done from the place the functions/classes are defined. This is inspired by this article and actually includes an AST based set of tests to guarantee imports are following the convention proposed in the article.

In some places I renamed files to they can be considered "private", since they were obviously leaves in our import graph (utils for instance)

I'm not sure we should merge it, I'm curious what you think @ybastide. Anyway it was fun to work on :-)