Migrating Ecoindex from micro services to polylith... #127
-
Hello, I am trying to migrate ecoindex project (composed from ecoindex_python, ecoindex_scraper, ecoindex_cli and ecoindex_api) from micro services to a polylith project using python-polylith. I understand the theory, but in practice, I think I must miss something 😄 I started this project yesterday https://github.com/vvatelot/ecoindex_monorepo and for now I am just trying to implement the basic components (ie compute) and run related tests. What I understand I have to do:
But here are the results: Example development script:
Pytest:
What am I doing wrong ? 🤔 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Hi @vvatelot! Glad that you are giving Polylith a try! I had a quick look at your repo and don't see anything wrong. I will clone your repo to look what might be wrong. |
Beta Was this translation helpful? Give feedback.
-
Hello again @vvatelot! I think I have found the issue, and it has something to do with It was the call to I haven't any experience with Here's what I tried out: Here I'm using a local virtual environment (recommended) with the poetry.toml confi. Here, being able to run the code in the |
Beta Was this translation helpful? Give feedback.
-
I'm just guessing: "get distribution", is that about extracting information from an imported package? If so maybe that is why the call fail, because it looks like it is doing a lookup on a (third party) package that doesn't exist. |
Beta Was this translation helpful? Give feedback.
-
Hello @DavidVujic thank you so much for your quick response! But anyway, it works, I will continue this work! |
Beta Was this translation helpful? Give feedback.
Hello again @vvatelot!
I think I have found the issue, and it has something to do with
pkg_resources
. I tried out running the code in the development folder in a REPL and found the cause for the error:It was the call to
get_distribution
https://github.com/vvatelot/ecoindex_monorepo/blob/main/components/ecoindex/models/compute.py#L39I haven't any experience with
pkg_resources
and what it does, but it seems thatimportlib
is a replacement?Here's what I tried out:
Here I'm using a local virtual environment (recommended) with the poetry.toml confi.
Here, being able to run the code in the
development
folder: