0

I have a question about the best way to write a setup.py script that can deal with a project I am working on. Basically, I am writing a python wrapper for an existing c library. Consequently, for my wrapper to run correctly, the third party library must be installed already when I do my linking against it. The third party library comes with a well written makefile, so there are a number of ways to deal with this.

For example, an approach such as this in setup.py might be useful:

import subprocess 

pr = subprocess.check_call(["git", "pull", "location of repo!")

and then navigating to the directory and running the makefile through this.

Alternatively, I have though of using a combination of this and git python

However, I have not seen either of these methods used in third party packages - and am not sure if there is a better way to do this

Community
  • 1
  • 1
user3684792
  • 2,542
  • 2
  • 18
  • 23
  • I assume just leaving it up to the user to have correctly installed the library before building your software isn't acceptable? (That's usually the normal expectation.) – Etan Reisner Jun 29 '15 at 11:13
  • There is a reason they invented package management. Are you also going to install the dependencies of the library in your setup? I don't know about your situation, but isn't it possible to write a `.deb` or `.rpm` or whatever with some dependencies? – David van rijn Jun 29 '15 at 11:16
  • I suppose this is an option. Maybe I will just forget about this and chuck it in the readme. – user3684792 Jun 29 '15 at 11:17

0 Answers0