Lawsun d230cfbce0 first commit 1 год назад
..
pytoml d230cfbce0 first commit 1 год назад
requirements d230cfbce0 first commit 1 год назад
README.md d230cfbce0 first commit 1 год назад
distPackage.py d230cfbce0 first commit 1 год назад
package.py d230cfbce0 first commit 1 год назад
pip_resolve.py d230cfbce0 first commit 1 год назад
pipfile.py d230cfbce0 first commit 1 год назад
reqPackage.py d230cfbce0 first commit 1 год назад
setup_file.py d230cfbce0 first commit 1 год назад
test_pip_resolve.py d230cfbce0 first commit 1 год назад
utils.py d230cfbce0 first commit 1 год назад

README.md

pysrc

This is the Python part of the snyk-python-plugin.

Given a fully installed Python package with its dependencies (using a virtual environment), it analyzes and returns the dependency tree.

The entry point is main in pip_resolve.py.

Implementation outline

  1. take pkg_resources.working_set (a list of all packages available in the current environment)
  2. convert it to a tree
  3. parse the manifest (requirements.txt/Pipfile) to find the top-level deps
  4. select the parts of the tree that start from TLDs found in previous step
  5. determine actual installed versions for the packages in the tree
  6. convert that tree in DepTree format

The parts 1 and 5 require access to the Python environment and thus have to be implemented in Python. The part 3, for requirements.txt, leverages the existing parsing library (pip).