Question about adding another local project as a dependency #9886
Unanswered
mark13hardware
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a project that's going to be installed onto a computer that doesn't have network access. Right now I've created two libraries, foo and bar. I thought I could just create a .whl for each, copy them from my development workstation to removable media, and install them on the destination computer with pip. But the foo library has the bar library as a dependency, and I'm not sure how to do this in poetry.
Running "poetry add bar ../bar" in the foo project (../bar is the path to where I'm developing the bar library) seemed to do the trick, but it looks like this results in a foo.whl that always wants to satisfy it's dependency on bar by building it with poetry in /home/mark13/foo instead of using of using the. I can create a directory like that in the destination computer, but installing poetry would be pretty difficult without network access.
As far as I can tell, the proper thing to do is add a source (https://python-poetry.org/docs/cli/#source-add) where poetry can find the bar library, then just do "poetry add bar". But as far as I can tell from the poetry docs, poetry doesn't support sources that aren't web servers. I did hope "poetry source add --priority=supplemental /home/mark13/foo" or "poetry source add --priority=supplemental file:///home/mark13/foo" would work, but both give the error: "A custom source cannot be added without a URL."
I can't upload to pypi as it's proprietary code, and I don't have access to a web server I can upload the packages to. I think I could figure out how to set up a python-based simple repository (https://peps.python.org/pep-0503/), but I was hoping I wouldn't have to go that far.
Is there a way for me to get poetry to create a .whl for the foo library that simply has the foo library as a dependency? Such that installing foo.whl via pip doesn't trigger trying to build bar via poetry?
Beta Was this translation helpful? Give feedback.
All reactions