2

Context

I have a wheel file of a Python CLI app (call it A) in an S3 bucket. Not the repo, not the source code, just the wheel, because "reasons". I also have access to the source code of a wrapper for A (call it B).

What's Needed

I would like to create a wheel file that will ideally install both A and B along with other dependencies available via PyPI, and distribute said wheel to multiple people many of whom may not (and need not) have access to the S3 bucket. I'm wondering if it's possible to package A within B's wheel such that when someone pip installs B.whl, A is picked up automatically.

What I have tried

I tried including a reference to A in B's setup.py under install_requires and the relative path to A (./deps/A.whl) under dependency_links, but that didn't work. The error I get is that pip could not find a version that satisfies the requirement of package A. I did not already know whether that would work or not for certain; just tried using the path instead of a URL.

Build command: python setup.py bdist_wheel

navneethc
  • 1,234
  • 8
  • 17
  • 1
    Just bumping this up. Anyone? – navneethc Nov 01 '20 at 11:46
  • What you're trying to do is very opposed to how you should be doing things. If anything, you're looking for a very ugly hack, but it might just be completely infeasible. A wheel doesn't contain setup code, so your local dependency must be able to be found right away. Given that the wrapping wheel is essentially a .zip, I don't see how you can get that to work. – Arne Nov 02 '20 at 21:12
  • If wheel A was a pure python package, you might be able to just extract the source code [using pip as described here](https://stackoverflow.com/questions/18812614/embedding-a-python-library-in-my-own-package/18812776) and thus vendor it the classical way. – Arne Nov 02 '20 at 21:16
  • Yeah, I agree that this is not a great solution. As I said, (work-related) "reasons". In any case, I've conveyed to my colleagues this is something difficult (and possibly even "wrong") to do and have offered suggestions to alternatives. – navneethc Nov 03 '20 at 11:25
  • Good for you. Sometimes there are technical solutions for "political" problems, but in this particular case it looks a bit too tough. Hope it works out! – Arne Nov 03 '20 at 12:08
  • Hey just curious how you went about this. I have a similar issue I’m confronted with currently. – drrkmcfrrk Jan 19 '22 at 20:26
  • Hi @dirkenstocks, I solved it by moving to another project. :D Seriously, this particular thing was a bit of a mess and didn't get anywhere. Hope you get your problem resolved. – navneethc Jan 20 '22 at 14:57

0 Answers0