If like us at The Data Refinery you have a private repository of code that you use across different projects and use poetry to manage dependencies within one of your python projects then you may have wondered how you would add that dependency.
Like many software or data engineers (or however you identify) the first thing you may do is head over to your favourite search engine and use a term something like “poetry add private git repo”.
For me I was greeted by a few links to the poetry docs which didn’t include what I was looking to do, some blogs which also didn’t detail the specific issue and some github issues within the poetry project.
So, with a failed web search I decided to start looking through the poetry cli documentation and found what I needed nestled in the add command. Makes sense right! So, the examples there are:
Fantastic, easy peasey lemon… oh wait! I’ve made a change to my shared repo to support a new feature across our organisation, let me just update that dependency…
This happens frequently for us, we are developing new features all the time and at pace. How does poetry know to update that dependency? Well, it doesn’t. So, what do you do when you want to get the latest changes from your private repo?
What next then? Well the only thing I could think to do next was to remove the private repo.
That’s it! I hope this helps anyone in the future who wants to add a private repo to poetry and avoids them from going through the pain I did to get this all working.