简体   繁体   中英

how to debug python package after git clone without running the setup.py

I have a git repository I've cloned and I've run the setup.py that installs the package. I have enough experience that I know how to insert ipdb.set_trace() into lines of code where I want to start debugging. I have not yet though understood how to run the cloned code in such a way that it's not being run form the binaries created by the setup.py and as I understand it, then compiled and untouchable.

Can someone illuminate as to how to execute a python package in this way?

Just the general course of actions.

  1. I'm on Ubuntu 13.10 and inside virtualenv

     virtualenv salt-test --system-site-packages 

    We need --system-site-packages due to some bugs after installation of M2Crypto inside virtualenv

  2. Prerequsites:

     apt-get install swig libssl-dev 
  3. git clone https://github.com/saltstack/salt.git

  4. cd salt
  5. pip install -r requirements.txt
  6. export PYTHONPATH=$PYTHONPATH:/path/to/salt
  7. Now we can run master daemon: ./scripts/salt-master -l debug

You'll see a lot of output and it would hint you what you need to create to run master properly.

NB: After installation I have to activated virtualenv under root to start master

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM